ACF\CLI
JsonCommand::get_type_label
Returns the friendly CLI type label for an internal post type slug.
Метод класса: JsonCommand{}
Хуков нет.
Возвращает
string. The friendly label (e.g. 'field-group'), or the original slug if not found.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_type_label( $post_type );
- $post_type(строка) (обязательный)
- The internal post type slug (e.g. 'acf-field-group').
Список изменений
| С версии 6.8 | Введена. |
Код JsonCommand::get_type_label() JsonCommand::get type label 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;
}