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


Main_Image::generate() public Yoast 1.0

Adds a main image for the current URL to the schema if there is one.

This can be either the featured image, or fall back to the first image in the content of the page.

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

Хуков нет.


false/Массив. $data Image Schema.


$Main_Image = new Main_Image();

Код Main_Image::generate() Yoast 15.6.2

public function generate() {
	$image_id = $this->context->canonical . Schema_IDs::PRIMARY_IMAGE_HASH;

	$image_schema = $this->get_featured_image( $this->context->id, $image_id );

	if ( $image_schema === null ) {
		$image_schema = $this->get_first_content_image( $this->context->id, $image_id );

	if ( $image_schema === null ) {
		return false;

	$this->context->has_image = true;

	return $image_schema;