WPSEO_Slug_Change_Watcher::get_post_type_label
Retrieves the singular post type label.
Метод класса: WPSEO_Slug_Change_Watcher{}
Хуков нет.
Возвращает
Строку. The singular post type name.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_post_type_label( $post_type );
- $post_type(строка) (обязательный)
- Post type to retrieve label from.
Код WPSEO_Slug_Change_Watcher::get_post_type_label() WPSEO Slug Change Watcher::get post type label Yoast 26.7
protected function get_post_type_label( $post_type ) {
$post_type_object = get_post_type_object( $post_type );
// If the post type of this post wasn't registered default back to post.
if ( $post_type_object === null ) {
$post_type_object = get_post_type_object( 'post' );
}
return $post_type_object->labels->singular_name;
}