Yoast\WP\SEO\Generators\Schema

Website::generate()publicYoast 1.0

Outputs code to allow recognition of the internal search engine.

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

Хуков нет.

Возвращает

Массив. Website data blob.

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

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

Код Website::generate() Yoast 24.0

public function generate() {
	$data = [
		'@type'       => 'WebSite',
		'@id'         => $this->context->site_url . Schema_IDs::WEBSITE_HASH,
		'url'         => $this->context->site_url,
		'name'        => $this->helpers->schema->html->smart_strip_tags( $this->context->site_name ),
		'description' => \get_bloginfo( 'description' ),
	];

	if ( $this->context->site_represents_reference ) {
		$data['publisher'] = $this->context->site_represents_reference;
	}

	$data = $this->add_alternate_name( $data );
	$data = $this->internal_search_section( $data );
	$data = $this->helpers->schema->language->add_piece_language( $data );

	return $data;
}