Yoast\WP\SEO\Generators\Schema
Breadcrumb::format_last_breadcrumb() private Yoast 1.0
Creates the last breadcrumb in the breadcrumb list. Provides a fallback for the URL and text:
- URL falls back to the canonical of current page.
- text falls back to the title of current page.
{} Это метод класса: Breadcrumb{}
Хуков нет.
Возвращает
Массив. The last of the breadcrumbs.
Использование
// private - только в коде основоного (родительского) класса $result = $this->format_last_breadcrumb( $breadcrumb );
- $breadcrumb(массив) (обязательный)
- The position in the list.
Код Breadcrumb::format_last_breadcrumb() Breadcrumb::format last breadcrumb Yoast 15.6.2
private function format_last_breadcrumb( $breadcrumb ) {
if ( empty( $breadcrumb['url'] ) ) {
$breadcrumb['url'] = $this->context->canonical;
}
if ( empty( $breadcrumb['text'] ) ) {
$breadcrumb['text'] = $this->helpers->schema->html->smart_strip_tags( $this->context->title );
}
return $breadcrumb;
}