Support

Account

Home Forums Backend Issues (wp-admin) Local JSON fallback? Reply To: Local JSON fallback?

  • Ok. I’ve had a look at the actual code and based on that, I’ve opted to unhook the current ACF functions and replaced them with my own. So with slight modification, this is the result:

    
    // Integrating Advanced Custom Fields:
    remove_filter( 'acf/settings/save_json', 'settings_save_json' );
    add_filter( 'acf/settings/save_json', function() {
        return get_stylesheet_directory() . '/Library/Acf-Json';
    } );
    remove_filter( 'acf/settings/load_json', 'settings_load_json' );
    add_filter( 'acf/settings/load_json', function( $paths ) {
        array_push(
            $paths,
            get_stylesheet_directory() . '/Library/Acf-Json',
            get_template_directory() . '/Library/Acf-Json'
        );
        return $paths;
    } );
    

    This seems to be the most effective way of getting ACF settings to use the parent theme as a fallback.