ACF\CLI

JsonCommand::get_type_labelprivateACF 6.8

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() 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;
}