Skip to content

Instantly share code, notes, and snippets.

@mtx-z
Created June 2, 2018 10:30
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 mtx-z/fd32eb19ee9ced5e319ec1c449b6eb95 to your computer and use it in GitHub Desktop.
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.
/**
* 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