Last active
March 8, 2019 14:32
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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