WordPress filter hook · part of WordPress core

the_author

A WordPress core filter that 16 plugins also fire themselves, running on 238K+ sites between them.

How to use the_author

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'the_author', function( $display_name ) {
	// Change $display_name here.
	return $display_name;
}, 10, 1 );

Argument names come from Blog-in-Blog's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

16 plugins that fire the_author

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Newsletter icon Newsletter200,000+ installs apply_filters( 'the_author', $authordata->display_name ) emails/blocks/posts/block.php:253
  2. Co-Authors Plus icon Co-Authors Plus20,000+ installs apply_filters( 'the_author', $author->display_name ) template-tags.php:290
  3. Subscribe2 icon Subscribe210,000+ installs apply_filters( 'the_author', $author->display_name ) classes/class-s2-core.php:657
  4. PublishPress Planner icon PublishPress Planner6,000+ installs apply_filters( 'the_author', $author_name ) common/php/class-module.php:1317
  5. Blog-in-Blog icon Blog-in-Blog800+ installs apply_filters( 'the_author', $user->display_name ) blog-in-blog.php:243
  6. Material Design for WordPress icon Material Design for WordPress700+ installs apply_filters( 'the_author', get_the_author_meta( 'display_name', $post_card->post_author ) ) php/template-parts/blocks/card-query.php:117
  7. ShMapper by Teplitsa icon ShMapper by Teplitsa100+ installs apply_filters( 'the_author', $authordata->display_name ) class/SMC_Post.php:151
  8. Live Blogging icon Live Blogging100+ installs apply_filters( 'the_author', $user->display_name ) live-blogging.php:1106
  9. Live Blogging Plus icon Live Blogging Plus50+ installs apply_filters( 'the_author', $user->display_name ) live-blogging-plus.php:1118
  10. Author Image(s) icon Author Image(s)50+ installs apply_filters( 'the_author', $author_name ) author-images.php:417
  11. BuddyPress Forums Extras icon BuddyPress Forums Extras10+ installs apply_filters( 'the_author', get_topic_author( $bb_topic->topic_id ) ) feeds/bp-forum-extras-group-forum-feed.php:39
  12. Additional Authors icon Additional Authors10+ installs apply_filters( 'the_author', is_object( $additional_author_archive_object ) ? $additional_author_archive_object->display_name : '' ) public-functions.php:69
  13. AWE Video icon AWE VideoFewer than 10 installs apply_filters( 'the_author', is_object($authordata) ? $authordata->display_name : null ) class-awe-videos-json.php:148
  14. Support Portal icon Support PortalFewer than 10 installs apply_filters( 'the_author', $topic_author_name ) templates/topic-single.php:14
  15. Arshida Toolkit for WooCommerce icon Arshida Toolkit for WooCommerceFewer than 10 installs apply_filters( 'the_author', is_object( $userdata ) ? $userdata->display_name : '' ) src/Theme/Main.php:1812
  16. Media Libraries icon Media LibrariesFewer than 10 installs apply_filters( 'the_author', is_object($author) ? $author->display_name : null ) review-template.php:119

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.