get_the_author() WP 1.5.0

Отримує ім’я ( display_name ) автора посту. Використовується усередині циклу WordPress.

Хуки з функції
$author = get_the_author();

Приклади

0

#1 Виведемо “публічне” ім’я автора:

echo get_the_author();

нотатки

  • Global. WP_User. $authordata The current author’s data.

список змін

З версії 1.5.0Введено.

Код get_the_author() WP 6.0.2

function get_the_author( $deprecated = '' ) { global $authordata; if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '2.1.0'); } /** * Filters display name of the current post's author. * * @ Since 2.9.0 * * @param string|null $display_name Введіть назву гравця. */ return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : null ); }

Залишити відповідь

Ваша e-mail адреса не оприлюднюватиметься. Обов’язкові поля позначені *