Filter hook 'the_author_{$field}'

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

View Source

the_author_{$field}

Filter Hook
Description
Filters the value of the requested user metadata. The filter name is dynamic and depends on the $field parameter of the function.

Hook Information

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

Hook Parameters

Type Name Description
string $author_meta The value of the metadata.
int|false $user_id The user ID.

Usage Examples

Basic Usage
<?php
// Hook into the_author_{$field}
add_filter('the_author_{$field}', 'my_custom_filter', 10, 2);

function my_custom_filter($author_meta, $user_id) {
    // Your custom filtering logic here
    return $author_meta;
}

Source Code Context

wp-includes/author-template.php:217 - How this hook is used in WordPress core
<?php
 212  	 * @since 2.8.0
 213  	 *
 214  	 * @param string    $author_meta The value of the metadata.
 215  	 * @param int|false $user_id     The user ID.
 216  	 */
 217  	echo apply_filters( "the_author_{$field}", $author_meta, $user_id );
 218  }
 219  
 220  /**
 221   * Retrieves either author's link or author's name.
 222   *

PHP Documentation

<?php
/**
	 * Filters the value of the requested user metadata.
	 *
	 * The filter name is dynamic and depends on the $field parameter of the function.
	 *
	 * @since 2.8.0
	 *
	 * @param string    $author_meta The value of the metadata.
	 * @param int|false $user_id     The user ID.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/author-template.php
Related Hooks

Related hooks will be displayed here in future updates.