Yoast\WP\SEO\Generators\Schema
Author::determine_user_id() protected Yoast 1.0
Determines a User ID for the Person data.
{} Это метод класса: Author{}
Хуки из метода
Возвращает
true/false/Число. User ID or false upon return.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->determine_user_id();
Код Author::determine_user_id() Author::determine user id Yoast 15.6.2
protected function determine_user_id() {
$user_id = 0;
if ( $this->context->indexable->object_type === 'post' ) {
$user_id = (int) $this->context->post->post_author;
}
if ( $this->context->indexable->object_type === 'user' ) {
$user_id = $this->context->indexable->object_id;
}
/**
* Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.
*
* @api int|bool $user_id The user ID currently determined.
*/
$user_id = \apply_filters( 'wpseo_schema_person_user_id', $user_id );
if ( \is_int( $user_id ) && $user_id > 0 ) {
return $user_id;
}
return false;
}