the_author_<field>

The value of the requested user metadata.

Description

apply_filters( 'the_author_<field>', (string) $author_meta, (int) $user_id ); 

The filter name is dynamic and depends on the $field parameter of the function.

Parameters (2)

0. $author_meta (string)
The value of the metadata.
1. $user_id (int)
The user id.

Usage

To run the hook, copy the example below.
  1. $author_meta = apply_filters( 'the_author_{$field}', $author_meta, $user_id ); 
  2.  
  3. if ( !empty( $author_meta ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the the_author_<field> callback 
  2. function filter_the_author_field( $author_meta, $user_id ) { 
  3. // make filter magic happen here... 
  4. return $author_meta
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "the_author_{$field}", 'filter_the_author_field', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "the_author_{$field}", 'filter_the_author_field', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/author-template.php  
  1. echo apply_filters( 'the_author_' . $field, $author_meta, $user_id );