Support

Account

Home Forums General Issues Handle acf-json outside of the theme Reply To: Handle acf-json outside of the theme

  • Here is the answer

    <?php
    add_filter('acf/settings/save_json', 'my_acf_json_save_point');
    
    function my_acf_json_save_point( $path ) {
    
    	// update path
    	$path = dirname( __FILE__ ) . '/acf-json';
    
    	// return
    	return $path;
    
    }
    
    add_filter('acf/settings/load_json', 'my_acf_json_load_point');
    
    function my_acf_json_load_point( $paths ) {
    
    	// remove original path (optional)
    	unset($paths[0]);
    
    	// append path
    	$paths[] = dirname( __FILE__ ) . '/acf-json';
    
    	// return
    	return $paths;
    
    }