функция
since 1.5.0
get_the_author()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
get_the_author( string $deprecated = '' ): string
Описание
Получает автора текущей записи.
Параметры
$deprecated
string
необязательный
= ''
Устаревший.
Возвращаемое значение
string
Исходный код
wp-includes/author-template.php:24
function get_the_author( $deprecated = '' ) {
global $authordata;
if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '2.1.0' );
}
/**
* Filters the display name of the current post's author.
*
* @since 2.9.0
*
* @param string $display_name The author's display name.
*/
return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : '' );
}
История изменений
| Версия | Описание |
|---|---|
| 6.3.0 | Returns an empty string if the author’s display name is unknown. |
| 1.5.0 | Introduced. |

