Skip to content

Instantly share code, notes, and snippets.

@mishterk
Last active June 3, 2022 19:32
Show Gist options
  • Save mishterk/f44db26a0ecde9202f8c2b85966cca06 to your computer and use it in GitHub Desktop.
Save mishterk/f44db26a0ecde9202f8c2b85966cca06 to your computer and use it in GitHub Desktop.
How to load ACF JSON files from additional directories. See https://www.awesomeacf.com/snippets/load-acf-json-files-from-multiple-locations/ for more details.
<?php
add_filter( 'acf/settings/load_json', function ( $paths ) {
$paths[] = get_template_directory() . '/some/custom/dir';
return $paths;
} );
<?php
add_filter( 'acf/settings/load_json', function ( $paths ) {
$paths[] = get_template_directory() . '/some/custom/dir';
$paths[] = WP_CONTENT_DIR . '/uploads/some/custom/dir';
$paths[] = '/some/system/path/dir';
return $paths;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment