WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Yoast\WP\SEO\Generators\Schema

Breadcrumb::generate() public Yoast 1.0

Returns Schema breadcrumb data to allow recognition of page's position in the site hierarchy.

{} Это метод класса: Breadcrumb{}

Хуков нет.

Возвращает

true/false/Массив. Array on success, false on failure.

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

$Breadcrumb = new Breadcrumb();
$Breadcrumb->generate();

Код Breadcrumb::generate() Yoast 15.6.2

<?php
public function generate() {
	$breadcrumbs   = $this->context->presentation->breadcrumbs;
	$list_elements = [];

	// In case of pagination, replace the last breadcrumb, because it only contains "Page [number]" and has no URL.
	if ( $this->helpers->current_page->is_paged() || ( $this->context->indexable->number_of_pages > 1 ) ) {
		\array_pop( $breadcrumbs );

		$breadcrumbs[] = [
			'url'  => $this->context->canonical,
			'text' => $this->context->title,
		];
	}

	// Only output breadcrumbs that are not hidden.
	$breadcrumbs = \array_filter( $breadcrumbs, [ $this, 'not_hidden' ] );

	\reset( $breadcrumbs );

	/*
	 * Check whether at least one of the breadcrumbs is broken.
	 * If so, do not output anything.
	 */
	foreach ( $breadcrumbs as $breadcrumb ) {
		if ( $this->is_broken( $breadcrumb ) ) {
			return false;
		}
	}

	// Create the last breadcrumb.
	$last_breadcrumb = \array_pop( $breadcrumbs );
	$breadcrumbs[]   = $this->format_last_breadcrumb( $last_breadcrumb );

	// If this is a static front page, prevent nested pages from creating a trail.
	if ( $this->helpers->current_page->is_home_static_page() ) {

		// Check if we're dealing with a nested page.
		if ( \count( $breadcrumbs ) > 1 ) {

			// Store the breadcrumbs home variable before dropping the parent page from the Schema.
			$breadcrumbs_home = $breadcrumbs[0]['text'];
			$breadcrumbs      = [ \array_pop( $breadcrumbs ) ];

			// Make the child page show the breadcrumbs home variable rather than its own title.
			$breadcrumbs[0]['text'] = $breadcrumbs_home;
		}
	}

	// Create intermediate breadcrumbs.
	foreach ( $breadcrumbs as $index => $breadcrumb ) {
		$list_elements[] = $this->create_breadcrumb( $index, $breadcrumb );
	}

	return [
		'@type'           => 'BreadcrumbList',
		'@id'             => $this->context->canonical . Schema_IDs::BREADCRUMB_HASH,
		'itemListElement' => $list_elements,
	];
}