Yoast\WP\SEO\Generators\Schema
Person::set_image_from_options()
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(массив) (обязательный)
- 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() Person::set image from options Yoast 21.6
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; }