get_the_author() WordPress Function

The get_the_author() function is used to return the author of the current post.

get_the_author( string $deprecated = '' ) #

Retrieves the author of the current post.


Parameters

$deprecated

(string)(Optional)Deprecated.

Default value: ''


Top ↑

Return

(string|null) The author's display name.


Top ↑

Source

File: wp-includes/author-template.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 );
}


Top ↑

Changelog

Changelog
VersionDescription
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.