Created
May 25, 2018 04:34
-
-
Save reidelliott/8ce69b73243cdb6b7753c47c6eb27d27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fix location of ACF local JSON. | |
* | |
* Since Sage does some surgery on the WordPress template locations, ACF looks in | |
* the wrong location for the acf-json directory. We will fix this by manually | |
* hooking into that functionality and attempting to save in the right spot. | |
* | |
* @param string $path | |
* @return string | |
*/ | |
add_filter('acf/settings/save_json', function ($path) { | |
$acf_json_dir = get_template_directory().'/acf-json'; | |
return (file_exists($acf_json_dir) && is_dir($acf_json_dir)) ? $acf_json_dir : $path; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment