Yoast\WP\SEO\Presenters
Meta_Author_Presenter::get()
Get the author's display name.
Метод класса: Meta_Author_Presenter{}
Хуки из метода
Возвращает
Строку
. The author's display name.
Использование
$Meta_Author_Presenter = new Meta_Author_Presenter(); $Meta_Author_Presenter->get();
Код Meta_Author_Presenter::get() Meta Author Presenter::get Yoast 22.3
public function get() { if ( $this->presentation->model->object_sub_type !== 'post' ) { return ''; } $user_data = \get_userdata( $this->presentation->context->post->post_author ); if ( ! $user_data instanceof WP_User ) { return ''; } /** * Filter: 'wpseo_meta_author' - Allow developers to filter the article's author meta tag. * * @param string $author_name The article author's display name. Return empty to disable the tag. * @param Indexable_Presentation $presentation The presentation of an indexable. */ return \trim( $this->helpers->schema->html->smart_strip_tags( \apply_filters( 'wpseo_meta_author', $user_data->display_name, $this->presentation ) ) ); }