WordPress at a glance

get_the_author() WP 1.0

Retrieve the author of the current post.

Возвращает

String/null. The author's display name.

Использование

get_the_author( $deprecated );
$deprecated(string)
Deprecated.
Default: ''

Заметки

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

Changelog

Since 1.5.0 Introduced.

Код get_the_author() WP 5.5.1

<?php
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|null $display_name The author's display name.
	 */
	return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : null );
}

From tag: WP Loop

More from category: Other

More from Template Tags: Authors

No comments
    Log In . Register