Yoast\WP\SEO\Generators\Schema
Author::generate() public Yoast 1.0
Returns Person Schema data.
{} Это метод класса: Author{}
Хуков нет.
Возвращает
true/false/Массив. Person data on success, false on failure.
Использование
$Author = new Author(); $Author->generate();
Код Author::generate() Author::generate Yoast 15.6.2
public function generate() {
$user_id = $this->determine_user_id();
if ( ! $user_id ) {
return false;
}
$data = $this->build_person_data( $user_id );
if ( $this->site_represents_current_author() === false ) {
$data['@type'] = [ 'Person' ];
unset( $data['logo'] );
}
// If this is an author page, the Person object is the main object, so we set it as such here.
if ( $this->context->indexable->object_type === 'user' ) {
$data['mainEntityOfPage'] = [
'@id' => $this->context->canonical . Schema_IDs::WEBPAGE_HASH,
];
}
return $data;
}