WordPress Hooks Explorer

Listing all hooks extracted WordPress Core


Details about pre_get_avatar

Back to home

Files

Filename Hook Type Line Number PHP Doc
wp-includes/pluggable.php apply_filters 2835 /**
* Allows the HTML for a user's avatar to be returned early.
*
* Returning a non-null value will effectively short-circuit get_avatar(), passing
* the value through the {@see 'get_avatar'} filter and returning early.
*
* @since 4.2.0
*
* @param string|null $avatar HTML for the user's avatar. Default null.
* @param mixed $id_or_email The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash,
* user email, WP_User object, WP_Post object, or WP_Comment object.
* @param array $args Arguments passed to get_avatar_url(), after processing.
*/

Hook Parameters

Parameter Type Name Description
string|null $avatar HTML for the user's avatar. Default null.
mixed $id_or_email The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash,
array $args Arguments passed to get_avatar_url(), after processing.