Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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