Filter hook 'the_author'

in WP Core File wp-includes/author-template.php at line 38

View Source

the_author

Filter Hook
Description
Filters the display name of the current post's author.

Hook Information

File Location wp-includes/author-template.php View on GitHub
Hook Type Filter
Line Number 38

Hook Parameters

Type Name Description
string $display_name The author's display name.

Usage Examples

Basic Usage
<?php
// Hook into the_author
add_filter('the_author', 'my_custom_filter', 10, 1);

function my_custom_filter($display_name) {
    // Your custom filtering logic here
    return $display_name;
}

Source Code Context

wp-includes/author-template.php:38 - How this hook is used in WordPress core
<?php
  33  	 *
  34  	 * @since 2.9.0
  35  	 *
  36  	 * @param string $display_name The author's display name.
  37  	 */
  38  	return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : '' );
  39  }
  40  
  41  /**
  42   * Displays the name of the author of the current post.
  43   *

PHP Documentation

<?php
/**
	 * Filters the display name of the current post's author.
	 *
	 * @since 2.9.0
	 *
	 * @param string $display_name The author's display name.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/author-template.php
Related Hooks

Related hooks will be displayed here in future updates.