I’m not exactly sure why you want to do this. If acf-json is a symlink in the template directory and you add get_template_directory().'/acf-json' as a path for ACF, writing a file to the symlink will write the file to the path in the symlink. This should be handled by your server’s file system, or PHP. The only thing I can think of that would prevent this is if PHP does not have permission to write to the path that is symlinked.
Yeah, I guess I don’t really need the readlink thing, I wasn’t sure if I needed it or not but basically I am using bedrock, trellis (vagrant) and I symlinked my theme for multiple sites that I develop on. I did troubleshoot some stuff last night after posting and did find it was failing on the permissions for the fopen command in json.php. So it must be how it gets mounted on my server that is keeping some permissions away. I thought maybe for some reason maybe you guys only check for real directories or something but even is_dir will recognize a symlink.
Just a quick update, I updated my server settings on the symlink I was mounting to 777 permissions, not really sure if that is the ideal thing I want but for now that seems to work. Just posting this here just in case this resonates with someone in the future.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users