Home › Forums › Add-ons › Flexible Content Field › Use PHP to add a field which can be managed in Admin? › Reply To: Use PHP to add a field which can be managed in Admin?
I don’t think that you’re using the right function. ACF is looking for a path and not a URI, so that might be affecting it. Try get_template_directory()
function my_acf_json_load_point( $paths ) {
// remove original path (optional)
unset($paths[0]);
// append path
$paths[] = get_template_directory() . '/acf-json-defaults';
// return
return $paths;
}
add_filter('acf/settings/load_json', 'my_acf_json_load_point');
Saving works independently of loading. If you have an acf-json folder in the current them folder ACF will always save the json there. There can only be one save point and that can be changed as well with the acf/settings/save_json hook.
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.