Skip to content

Instantly share code, notes, and snippets.

@loorlab
Created May 16, 2025 23:49
Show Gist options
  • Save loorlab/82e4b656a534aa0b922398b7d31ea65c to your computer and use it in GitHub Desktop.
Save loorlab/82e4b656a534aa0b922398b7d31ea65c to your computer and use it in GitHub Desktop.
Show all groups and fields associated with the CPT person (all in one) - WP CLI
wp eval '
$field_groups = acf_get_field_groups(["post_type" => "person"]);
foreach ($field_groups as $group) {
echo "Grupo: {$group["title"]} (key: {$group["key"]})\n";
$fields = acf_get_fields($group["key"]);
if ($fields) {
foreach ($fields as $field) {
echo " - {$field["label"]} ({$field["name"]}) tipo: {$field["type"]}\n";
}
} else {
echo " (Sin campos definidos)\n";
}
echo "\n";
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment