Home › Forums › General Issues › Load fields from PHP exported file by default › Reply To: Load fields from PHP exported file by default
Ok, I have solved this issue by myself. The reason why the PHP exported file is not loading inside the if condition, I have loaded the JSON files at the same time with the following code:
if ( ! function_exists( 'acf_json_load_point' ) ) :
function acf_json_load_point( $paths ) {
unset($paths[0]); // remove original path (optional)
$paths[] = get_stylesheet_directory() . '/inc/acf-json'; // append path
return $paths;
}
endif;
add_filter('acf/settings/load_json', 'acf_json_load_point');
If I load the “PHP exported file” OR the “JSON files” only, handled by a if condition, everything is fine and it works great 🙂
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.