Support

Account

Home Forums ACF PRO Conditionally Load .json files Reply To: Conditionally Load .json files

  • add_filter('acf/settings/load_json', 'my_acf_json_load_point');
    
    function my_acf_json_load_point( $paths ) {
        $custom-json-folder = '';//PUT HERE YOUR PATH LOADER BASED ON OPTIONS
        unset($paths[0]);
        $paths[] = get_stylesheet_directory() . '/my-custom-folder/'.$custom-json-folder;
        // return
        return $paths;
    }