Support

Account

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

  • @benjamin74

    it’s most like my code just some differences:

    1) i set third parameter as 1 (small difference i think)

    add_filter('acf/settings/load_json', 'red_template_json_load_point', 1);
    add_filter('acf/settings/save_json', 'red_template_json_save_point', 1);
    
    function red_template_json_load_point( $paths ) { 
        // remove original path (optional)
        unset($paths[0]);
        // append path
        $paths[] = get_template_directory() . '/includes/acf_json';
        // return
        return $paths;
    }
    
    function red_template_json_save_point( $path ) { 
        // update path
        $path = get_template_directory() . '/includes/acf_json';
        // return
        return $path;
    }

    2) i use “options” and not “option”. Perhaps this?

    $red_tmp_font_h1_font = get_field("h1_red_tmp_font_h1_font","options");