Created
March 6, 2020 06:07
-
-
Save harisrozak/f5ae8c283eeba9cd45fe46dc953c36e8 to your computer and use it in GitHub Desktop.
WordPress :: Save ACF settings to json
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 | |
/** | |
* Save ACF settings to json | |
*/ | |
add_filter( 'acf/settings/load_json', 'astahub_acf_json_load' ); | |
add_filter( 'acf/settings/save_json', 'astahub_acf_json_save' ); | |
function astahub_get_acf_path() { | |
return get_template_directory() . '/acf-json'; | |
} | |
function astahub_acf_json_load( $paths ) { | |
$paths[] = astahub_get_acf_path(); | |
return $paths; | |
} | |
function astahub_acf_json_save() { | |
return astahub_get_acf_path(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment