Yoast\WP\SEO\Generators\Schema
Person::site_represents_current_author()
Checks the site is represented by the same person as this indexable.
Метод класса: Person{}
Хуков нет.
Возвращает
true|false
. True when the site is represented by the same person as this indexable.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->site_represents_current_author( $user_data );
- $user_data(WP_User)
- User data.
По умолчанию: null
Код Person::site_represents_current_author() Person::site represents current author Yoast 24.6
protected function site_represents_current_author( $user_data = null ) { // Can only be the case when the site represents a user. if ( $this->context->site_represents !== 'person' ) { return false; } // Article post from the same user as the site represents. if ( $this->context->indexable->object_type === 'post' && $this->helpers->schema->article->is_author_supported( $this->context->indexable->object_sub_type ) && $this->context->schema_article_type !== 'None' ) { $user_id = ( ( ! \is_null( $user_data ) ) && ( isset( $user_data->ID ) ) ) ? $user_data->ID : $this->context->indexable->author_id; return $this->context->site_user_id === $user_id; } // Author archive from the same user as the site represents. return $this->context->indexable->object_type === 'user' && $this->context->site_user_id === $this->context->indexable->object_id; }