apply_filters( 'pre_get_avatar', string|null $avatar, mixed $id_or_email, array $args )

Allows the HTML for a user’s avatar to be returned early.

Description Description

Passing a non-null value will effectively short-circuit get_avatar(), passing the value through the ‘get_avatar’ filter and returning early.

Top ↑

Parameters Parameters


(string|null) HTML for the user's avatar. Default null.


(mixed) The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.


(array) Arguments passed to get_avatar_url(), after processing.

Top ↑

Source Source

File: wp-includes/pluggable.php

View on Trac

Top ↑

Changelog Changelog

Version Description
4.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

Top ↑

You must log in before being able to contribute a note or feedback.