Home › Forums › ACF PRO › acf-json fields not loading from parent theme › Reply To: acf-json fields not loading from parent theme
Has anyone been able to do something similar with the save function?
I copied @johanhermansson suggestion into the save filter, but am getting this error:
[18-Mar-2019 22:20:21 UTC] PHP Warning: rtrim() expects parameter 1 to be string, array given in .../wp-includes/formatting.php on line 2660
add_filter('acf/settings/save_json', 'my_acf_json_save_point');
function my_acf_json_save_point( $path ) {
$paths = array(THEME_DIR.'/config/acf-configs/acf-json');
if(is_child_theme()) {
//If we are in the child theme, check for child theme specific json files
$paths[] = CHILD_THEME_DIR.'/config/acf-configs/acf-json';
}
// return
return $paths;
}
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.