avatar_defaults

Filters the default avatars.

Description

apply_filters( 'avatar_defaults', (array) $avatar_defaults ); 

Avatars are stored in key/value pairs, where the key is option value, and the name is the displayed avatar name.

Parameters (1)

0. $avatar_defaults (array)
Array of default avatars.

Usage

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

Defined (1)

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

/wp-admin/options-discussion.php  
  1. $avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults );