Yoast\WP\SEO\Generators\Schema

Breadcrumb::is_needed()publicYoast 1.0

Determine if we should add a breadcrumb attribute.

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

Хуков нет.

Возвращает

true|false.

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

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

Код Breadcrumb::is_needed() Yoast 22.4

public function is_needed() {
	if ( $this->context->indexable->object_type === 'unknown' ) {
		return false;
	}

	if ( $this->context->indexable->object_type === 'system-page' && $this->context->indexable->object_sub_type === '404' ) {
		return false;
	}

	return true;
}