Skip to content

Instantly share code, notes, and snippets.

@holisticnetworking
Last active March 8, 2019 14:32
Show Gist options
  • Save holisticnetworking/e5def0aa68b8beffb6eae0fd3db5abc2 to your computer and use it in GitHub Desktop.
Save holisticnetworking/e5def0aa68b8beffb6eae0fd3db5abc2 to your computer and use it in GitHub Desktop.
A first attempt at applying new directories with parent failovers to ACF local JSON
<?php
// Integrating Advanced Custom Fields:
add_filter( 'acf/settings/save_json', function() {
return get_stylesheet_directory() . '/Library/Acf-Json';
} );
add_filter( 'acf/settings/load_json', function( $paths ) {
unset( $paths[0] );
$paths[] = get_template_directory() . '/Library/Acf-Json';
$paths[] = get_stylesheet_directory() . '/Library/Acf-Json';
return $paths;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment