WPSEO_Schema_Person::get_social_profiles() protected Yoast 1.0
Устарела с версии 14.0. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.╳
Retrieve a list of social profile URLs for Person.
{} Это метод класса: WPSEO_Schema_Person{}
Хуки из метода
Возвращает
Строку[]
. $output A list of social profiles.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_social_profiles( $user_id );
- $user_id(число) (обязательный)
- User ID.
Список изменений
Устарела с | 14.0 |
Код WPSEO_Schema_Person::get_social_profiles() WPSEO Schema Person::get social profiles Yoast 16.1.1
protected function get_social_profiles( $user_id ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::get_social_profiles' );
/**
* Filter: 'wpseo_schema_person_social_profiles' - Allows filtering of social profiles per user.
*
* @param int $user_id The current user we're grabbing social profiles for.
*
* @api string[] $social_profiles The array of social profiles to retrieve. Each should be a user meta field
* key. As they are retrieved using the WordPress function `get_the_author_meta`.
*/
$social_profiles = \apply_filters( 'wpseo_schema_person_social_profiles', $this->social_profiles, $user_id );
$output = [];
// We can only handle an array.
if ( ! \is_array( $social_profiles ) ) {
return $output;
}
foreach ( $social_profiles as $profile ) {
// Skip non-string values.
if ( ! \is_string( $profile ) ) {
continue;
}
$social_url = $this->url_social_site( $profile, $user_id );
if ( $social_url ) {
$output[] = $social_url;
}
}
return $output;
}