Yoast\WP\SEO\Generators

Breadcrumbs_Generator::get_system_page_crumb()privateYoast 1.0

Returns the modified system page crumb.

Метод класса: Breadcrumbs_Generator{}

Хуков нет.

Возвращает

Строку[]. The crumb.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_system_page_crumb( $crumb, $ancestor );
$crumb(string[]) (обязательный)
The crumb.
$ancestor(Indexable) (обязательный)
The indexable.

Код Breadcrumbs_Generator::get_system_page_crumb() Yoast 22.3

private function get_system_page_crumb( $crumb, $ancestor ) {
	if ( $ancestor->object_sub_type === 'search-result' ) {
		$crumb['text'] = $this->options->get( 'breadcrumbs-searchprefix' ) . ' ' . \esc_html( \get_search_query() );
		$crumb['url']  = \get_search_link();
	}
	elseif ( $ancestor->object_sub_type === '404' ) {
		$crumb['text'] = $this->options->get( 'breadcrumbs-404crumb' );
	}

	return $crumb;
}