Yoast\WP\SEO\Abilities\Application
Author_Schema_Updater::get_x_username
Returns the X username from an X username, with or without a leading @, or profile URL, cleaned up like the organization's X username.
Unlike the organization's X username, the user's one is not cleaned up when saved, while the schema and the meta tags expect a username.
Метод класса: Author_Schema_Updater{}
Хуков нет.
Возвращает
string. The X username, or the value as provided when it is empty or not valid, for the social profiles helper to reject.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_x_username( $value ): string;
- $value(строка) (обязательный)
- The X username or profile URL.
Код Author_Schema_Updater::get_x_username() Author Schema Updater::get x username Yoast 28.9
private function get_x_username( string $value ): string {
if ( $value === '' ) {
return $value;
}
$x_username = $this->options_helper->get_twitter_id( $value );
return ( \is_string( $x_username ) ) ? $x_username : $value;
}