get_the_author
Retrieve the author of the current post.
Description
(string|null) get_the_author( (string) $deprecated = '' );
Returns (string|null)
The author's display name.
Parameters (1)
- 0. $deprecated — Optional. (string) =>
''
- The deprecated.
Usage
if ( !function_exists( 'get_the_author' ) ) { require_once ABSPATH . WPINC . '/author-template.php'; } // The deprecated. $deprecated = ''; // NOTICE! Understand what this does before running. $result = get_the_author($deprecated);
Defined (1)
The function is defined in the following location(s).
- /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 $authordata->display_name The author's display name.
- */
- return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
- }