Last active
January 11, 2024 16:09
-
-
Save lgladdy/48863dfc593da85130e4140ce8fd35bc to your computer and use it in GitHub Desktop.
Revisions
-
lgladdy revised this gist
Aug 8, 2023 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,11 +11,11 @@ function set_custom_json_load_paths( $paths ) { add_filter( 'acf/settings/save_json/type=acf-post-type', 'set_custom_json_save_path_for_post_types' ); function set_custom_json_save_path_for_post_types() { return get_stylesheet_directory() . '/acf-json/post-types'; } add_filter( 'acf/settings/save_json/type=acf-field-group', 'set_custom_json_save_path_for_field_groups' ); function set_custom_json_save_path_for_field_groups() { return get_stylesheet_directory() . '/acf-json/field-groups'; } add_filter( 'acf/settings/save_json/type=acf-taxonomy', 'set_custom_json_save_path_for_taxonomies' ); function set_custom_json_save_path_for_taxonomies() { -
lgladdy created this gist
Aug 8, 2023 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ <?php add_filter( 'acf/json/load_paths', 'set_custom_json_load_paths' ); function set_custom_json_load_paths( $paths ) { $paths[] = get_stylesheet_directory() . '/acf-json/post-types'; $paths[] = get_stylesheet_directory() . '/acf-json/field-groups'; $paths[] = get_stylesheet_directory() . '/acf-json/taxonomies'; $paths[] = get_stylesheet_directory() . '/acf-json/option-pages'; return $paths; } add_filter( 'acf/settings/save_json/type=acf-post-type', 'set_custom_json_save_path_for_post_types' ); function set_custom_json_save_path_for_post_types() { return get_stylesheet_directory() . '/acf-json/post_types'; } add_filter( 'acf/settings/save_json/type=acf-field-group', 'set_custom_json_save_path_for_field_groups' ); function set_custom_json_save_path_for_field_groups() { return get_stylesheet_directory() . '/acf-json/field_groups'; } add_filter( 'acf/settings/save_json/type=acf-taxonomy', 'set_custom_json_save_path_for_taxonomies' ); function set_custom_json_save_path_for_taxonomies() { return get_stylesheet_directory() . '/acf-json/taxonomies'; } add_filter( 'acf/settings/save_json/type=acf-ui-options-page', 'set_custom_json_save_path_for_option_pages' ); function set_custom_json_save_path_for_option_pages() { return get_stylesheet_directory() . '/acf-json/option-pages'; } add_filter( 'acf/json/save_file_name', function( $filename, $post, $load_path ) { return empty( $load_path ) ? $filename : basename( $load_path ); }, 10, 3 );