Yoast\WP\SEO\Builders
Indexable_Post_Type_Archive_Builder::get_breadcrumb_title() private Yoast 1.0
Returns the fallback breadcrumb title for a given post.
{} Это метод класса: Indexable_Post_Type_Archive_Builder{}
Хуков нет.
Возвращает
Строку.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_breadcrumb_title( $post_type );
- $post_type(строка) (обязательный)
- The post type to get the fallback breadcrumb title for.
Код Indexable_Post_Type_Archive_Builder::get_breadcrumb_title() Indexable Post Type Archive Builder::get breadcrumb title Yoast 15.6.2
private function get_breadcrumb_title( $post_type ) {
$options_breadcrumb_title = $this->options->get( 'bctitle-ptarchive-' . $post_type );
if ( $options_breadcrumb_title !== '' ) {
return $options_breadcrumb_title;
}
$post_type_obj = \get_post_type_object( $post_type );
if ( ! \is_object( $post_type_obj ) ) {
return '';
}
if ( isset( $post_type_obj->label ) && $post_type_obj->label !== '' ) {
return $post_type_obj->label;
}
if ( isset( $post_type_obj->labels->menu_name ) && $post_type_obj->labels->menu_name !== '' ) {
return $post_type_obj->labels->menu_name;
}
return $post_type_obj->name;
}