Home › Forums › ACF PRO › Local JSON in plugin not load › Reply To: Local JSON in plugin not load
I’m having issues with the synchronization feature as well. The save point works fine. The files get stored in the right place and update each time I save a group. The sync available
option, however, does not appear as predicted after I pull relevant changes from my repo onto my other machine (which, in fact, has no field groups in its DB). Neither does the option appear on the original machine after I edit the files directly. I even incremented the modified
property.
These are my save and load points:
add_filter('acf/settings/save_json', 'p2c_acf_json_save_point');
function p2c_acf_json_save_point( $path ) {
$path = plugin_dir_path(__FILE__) . 'fields/acf-json';
return $path;
}
add_filter('acf/settings/load_json', 'p2c_acf_json_load_point');
function p2c_acf_json_load_point( $paths ) {
unset($paths[0]);
$paths[] = plugin_dir_path(__FILE__) . 'fields/acf-json';
return $paths;
}
Permissions on the directory are writeable. I use username:www-data
as owner:group
in my local environment with 775 permissions.
I also tried adjusting the priority of the filters to no effect. plugin_dir_path()
already provides the trailing slash and I verified that the correct directory is pushed to $paths
(and the default removed).
Any ideas?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
❓Ever wondered when and why ACF uses JSON instead of the database? Check out our summary of the most recent session of ACF Chat Friday for the answer, and make sure to register for the next session.
— Advanced Custom Fields (@wp_acf) February 23, 2023
👉 https://t.co/3UtvQbDwNmhttps://t.co/wfFEVcXVKc
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.