Support

Account

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 🙂