get_avatar_url
Filters the avatar URL.
Usage
add_filter( 'get_avatar_url', 'wp_kama_get_avatar_url_filter', 10, 3 );
/**
* Function for `get_avatar_url` filter-hook.
*
* @param string $url The URL of the avatar.
* @param mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar SHA-256 or MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.
* @param array $args Arguments passed to get_avatar_data(), after processing.
*
* @return string
*/
function wp_kama_get_avatar_url_filter( $url, $id_or_email, $args ){
// filter...
return $url;
}
- $url(string)
- The URL of the avatar.
- $id_or_email(mixed)
- The avatar to retrieve. Accepts a user ID, Gravatar SHA-256 or MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.
- $args(array)
- Arguments passed to get_avatar_data(), after processing.
Changelog
| Since 4.2.0 | Introduced. |
Where the hook is called
wp-includes/link-template.php 4622
$args['url'] = apply_filters( 'get_avatar_url', $url, $id_or_email, $args );