Skip to content

Instantly share code, notes, and snippets.

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 schutzsmith/551649bd2670a86de1f2a4b2a21cd379 to your computer and use it in GitHub Desktop.
Save schutzsmith/551649bd2670a86de1f2a4b2a21cd379 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