Yoast\WP\SEO\Generators\Schema

Person::set_image_from_options()protectedYoast 1.0

Generate the person image from our settings.

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

Хуков нет.

Возвращает

Массив<Строку|Строку[]>. The Person schema.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->set_image_from_options( $data, $schema_id, $add_hash, $user_data );
$data(array<string|string[]>) (обязательный)
The Person schema.
$schema_id(строка) (обязательный)
The string used in the @id for the schema.
$add_hash(true|false)
Whether or not the person's image url hash should be added to the image id.
По умолчанию: false
$user_data(WP_User)
User data.
По умолчанию: null

Код Person::set_image_from_options() Yoast 22.4

protected function set_image_from_options( $data, $schema_id, $add_hash = false, $user_data = null ) {
	if ( $this->context->site_represents !== 'person' ) {
		return $data;
	}
	if ( \is_array( $this->context->person_logo_meta ) ) {
		$data['image'] = $this->helpers->schema->image->generate_from_attachment_meta( $schema_id, $this->context->person_logo_meta, $data['name'], $add_hash );
	}

	return $data;
}