Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

get_avatar_url()

3 tags 1 category

get_avatar_url() — Retrieves the avatar URL.

Inputs: $id_or_email (mixed): The avatar to retrieve a URL for. Accepts a user ID, Gravatar SHA-256 or MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object. $args (array): Optional. Arguments to use instead of the default arguments. Field $size (int): Height and width of the avatar in pixels. Default 96. Field $default (string): URL for the default image or a default type. Accepts: ‘404’ (return a 404 instead of a default image) ‘retro’ (a 8-bit arcade-style pixelated face) ‘robohash’ (a robot) ‘monsterid’ (a monster) ‘wavatar’ (a cartoon face) ‘identicon’ (the “quilt”, a geometric pattern) ‘initials’ (initials based avatar with background color) ‘color’ (generated background color) ‘mystery’, ‘mm’, or ‘mysteryman’ (The Oyster Man) ‘blank’ (transparent GIF) ‘gravatar_default’ (the Gravatar logo) Default is the value of the ‘avatar_default’ option, with a fallback of ‘mystery’.

Returns string|false: The URL of the avatar on success, false on failure.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…