WordPress at a glance

get_the_author() WP 1.0

Retrieve the author of the current post.

  • Global. Object. $authordata The current author's DB object.
Hooks in function
Return

String/null. The author's display name.

Usage

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

Code of get the author: wp-includes/author-template.php WP 5.2.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 $authordata->display_name The author's display name.
	 */
	return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : null );
}

Related Functions

From tag: WP Loop

More from category: Other

More from Template Tags: Authors

No comments
    Hello, !     Log In . Register