Skip to content

Instantly share code, notes, and snippets.

@harisrozak
Created March 6, 2020 06:07
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 harisrozak/f5ae8c283eeba9cd45fe46dc953c36e8 to your computer and use it in GitHub Desktop.
Save harisrozak/f5ae8c283eeba9cd45fe46dc953c36e8 to your computer and use it in GitHub Desktop.
WordPress :: Save ACF settings to json
<?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