Created
May 16, 2025 23:49
-
-
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
This file contains hidden or 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
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