get_avatar
get_avatar ( $id_or_email, $size = 96, $default = '', $alt = '', $args = null )
Parameters:- (mixed) $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.
- (int) $size Optional. Height and width of the avatar image file in pixels. Default 96.
- (string) $default Optional. URL for the default image or a default type. Accepts '404' (return a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster), 'wavatar' (cartoon face), 'indenticon' (the "quilt"), 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or 'gravatar_default' (the Gravatar logo). Default is the value of the 'avatar_default' option, with a fallback of 'mystery'.
- (string) $alt Optional. Alternative text to use in <img> tag. Default empty.
- (array) $args { Optional. Extra arguments to retrieve the avatar.
Returns:- (false|string) `<img>` tag for the user's avatar. False on failure.
Defined at:Change Log: - Introduced in WordPress: 2.5.0
- Deprecated in WordPress: —
Description
Retrieve the avatar `
![]()
` tag for a user, email address, MD5 hash, comment, or post.