ACF\CLI
JsonCommand::get_type_label
Returns the friendly CLI type label for an internal post type slug.
Method of the class: JsonCommand{}
No Hooks.
Returns
String. The friendly label (e.g. 'field-group'), or the original slug if not found.
Usage
// private - for code of main (parent) class only $result = $this->get_type_label( $post_type );
- $post_type(string) (required)
- The internal post type slug (e.g. 'acf-field-group').
Changelog
| Since 6.8 | Introduced. |
JsonCommand::get_type_label() JsonCommand::get type label code ACF 6.8.8
private function get_type_label( $post_type ) {
$label = array_search( $post_type, self::TYPE_MAP, true );
return $label ? $label : $post_type;
}