Yoast\WP\SEO\Generators\Schema
Person::url_social_site
Returns an author's social site URL.
Метод класса: Person{}
Хуков нет.
Возвращает
string.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->url_social_site( $social_site, $user_id );
- $social_site(строка) (обязательный)
- The social site to retrieve the URL for.
- $user_id(int|false)
- The user ID to use function outside of the loop.
По умолчанию:false
Код Person::url_social_site() Person::url social site Yoast 28.4
protected function url_social_site( $social_site, $user_id = false ) {
$url = \get_the_author_meta( $social_site, $user_id );
if ( ! empty( $url ) && $social_site === 'twitter' ) {
$url = 'https://x.com/' . $url;
}
return $url;
}