Last active
June 4, 2018 11:12
-
-
Save timothyjensen/c8d8211effa8f098438700d828c21adb to your computer and use it in GitHub Desktop.
Use ACF local JSON file for get_all_custom_field_meta().
This file contains 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 | |
// 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']; | |
$meta_data = get_all_custom_field_meta( get_the_ID(), $config ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you might want to check if the file exists before decoding the json