Created
June 2, 2018 10:30
-
-
Save mtx-z/fd32eb19ee9ced5e319ec1c449b6eb95 to your computer and use it in GitHub Desktop.
ACF-json with Roots Sage 9 - get_stylesheet_directory() point to theresources/ folder. From local JSON ACF documentation.
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
/** | |
* ACF save json folder | |
*/ | |
add_filter( 'acf/settings/save_json', 'my_acf_json_save_point' ); | |
function my_acf_json_save_point( $path ) { | |
return get_stylesheet_directory() . '/acf-json-custom-folder'; | |
} | |
/** | |
* ACF load json folder | |
*/ | |
add_filter( 'acf/settings/load_json', 'my_acf_json_load_point' ); | |
function my_acf_json_load_point( $paths ) { | |
$paths[] = get_stylesheet_directory() . '/acf-json-custom-folder'; | |
return $paths; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment