Yoast\WP\SEO\Generators\Schema

Person::url_social_site()protectedYoast 1.0

Returns an author's social site URL.

Метод класса: Person{}

Хуков нет.

Возвращает

Строку.

Использование

// 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() Yoast 22.3

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://twitter.com/' . $url;
	}

	return $url;
}