Skip to content

Instantly share code, notes, and snippets.

@timothyjensen
timothyjensen / acf-local-json.php
Last active June 4, 2018 11:12
Use ACF local JSON file for get_all_custom_field_meta().
<?php
// Replace with the name of your field group JSON.
$field_group_json = 'group_59e226a200966.json';
$field_group_array = json_decode( file_get_contents( get_stylesheet_directory() . "/acf-json/{$field_group_json}" ), true );
// Omit this line when using the Field Group Values package/plugin.
$config = $field_group_array['fields'];