Forked from mishterk/register-acf-json-load-directory.php
Created
June 3, 2022 19:32
-
-
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.
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 characters
<?php | |
add_filter( 'acf/settings/load_json', function ( $paths ) { | |
$paths[] = get_template_directory() . '/some/custom/dir'; | |
return $paths; | |
} ); | |
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 characters
<?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