Hello
I have a few sites on a multisite network and am looking for a way to keep the acf in sync using acf sync.
Using this article I’ve changed the save and load directory of acf-json in each site’s functions.php file, code below. However the json files aren’t going in to the folder.
Any ideas how, or if, I can achieve this? Perhaps I’m going about it the wrong way.
// ACF SAVE
add_filter('acf/settings/save_json', 'my_acf_json_save_point');
function my_acf_json_save_point( $path ) {
// update path
$path = get_stylesheet_directory() . '../KAWmaster/acf-json';
// return
return $path;
}
// ACF LOAD
add_filter('acf/settings/load_json', 'my_acf_json_load_point');
function my_acf_json_load_point( $paths ) {
// remove original path (optional)
unset($paths[0]);
// append path
$paths[] = get_stylesheet_directory() . '../KAWmaster/acf-json';
// return
return $paths;
}
$paths[] = get_stylesheet_directory().'/../KAWmaster/acf-json';
or
$paths[] = dirname(get_stylesheet_directory()).'/KAWmaster/acf-json';
Hi, i’ve just posted an answer about it, please, check if it can help you:
https://support.advancedcustomfields.com/forums/topic/acf-json-not-updating/#post-54584
I’ve changed the get_stylesheet_diretory() to get_template_directory(), that way i need to update only my parent theme and the child themes inherit.
Don’t need to use the config load and save on each site, only in the main-parent-theme.