Skip to content

Instantly share code, notes, and snippets.

@holisticnetworking
Last active March 8, 2019 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holisticnetworking/3b7f88ff960271fddddc19ee5040735d to your computer and use it in GitHub Desktop.
Save holisticnetworking/3b7f88ff960271fddddc19ee5040735d to your computer and use it in GitHub Desktop.
A successful addition to my theme to allow parent/theme failover of local JSON
<?php
// 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;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment