Support

Account

Home Forums General Issues get_field returning null after update Reply To: get_field returning null after update

  • It has always worked for me. Of course I’m loading local json ACF fields before any call.

    But I’m using ONLY json, i.e. I do NOT SYNC from json.

    Here is the code I’m using:

    
    // 1.9 Now support LOCAL ACF JSON FIELD DEFINITION
    //https://www.advancedcustomfields.com/resources/local-json/
    //https://awesomeacf.com/how-to-avoid-conflicts-when-using-the-acf-local-json-feature/
    // ON PRODUCTION, DON'T SYNC AND NEVER EDIT THE FIELD SETTINGS IN ACF
    add_filter('acf/settings/save_json', 'bja_wf_acf_json_save_point');
    function ben_wf_acf_json_save_point( $path ) {
    	// update path
    	$path = BENWF_PLUGIN_PATH . 'acf-config';
    	// return
    	return $path;
    }
    
    add_filter('acf/settings/load_json', 'ben_wf_acf_json_load_point');
    function ben_wf_acf_json_load_point( $paths ) {
    	// remove original path (optional)
    	unset($paths[0]);
    	// append path
    	$paths[] = BENWF_PLUGIN_PATH . 'acf-config';
    	// return
    	return $paths;
    }
    

    e.g. like as described in this article here:
    https://www.awesomeacf.com/how-to-avoid-conflicts-when-using-the-acf-local-json-feature/
    see chapter “The preventative workflow” -> I’m using option 1 described in that paragraph.