Yoast\WP\SEO\Generators\Schema
Person::set_image_from_options() protected Yoast 1.0
Generate the person image from our settings.
{} Это метод класса: Person{}
Хуков нет.
Возвращает
Массив. The Person schema.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->set_image_from_options( $data, $schema_id );
- $data(массив) (обязательный)
- The Person schema.
- $schema_id(строка) (обязательный)
- The string used in the @id for the schema.
Код Person::set_image_from_options() Person::set image from options Yoast 15.7
protected function set_image_from_options( $data, $schema_id ) {
if ( $this->context->site_represents !== 'person' ) {
return $data;
}
$person_logo_id = $this->helpers->image->get_attachment_id_from_settings( 'person_logo' );
if ( $person_logo_id ) {
$data['image'] = $this->helpers->schema->image->generate_from_attachment_id( $schema_id, $person_logo_id, $data['name'] );
}
return $data;
}