Skip to content

Instantly share code, notes, and snippets.

@Ciantic
Last active January 27, 2020 21:04
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 Ciantic/02187f3127663ca8002a3acf9517bc5f to your computer and use it in GitHub Desktop.
Save Ciantic/02187f3127663ca8002a3acf9517bc5f to your computer and use it in GitHub Desktop.
<?php
$groups = acf_get_local_field_groups();
$json = [];
foreach ($groups as $group) {
$fields = acf_get_fields($group['key']);
unset($group['ID']);
$group['fields'] = $fields;
$json[] = $group;
}
$json = json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
echo $json;
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment