Opened 9 years ago
Closed 6 years ago
#35920 closed feature request (wontfix)
Function to check if user has a gravatar account
Reported by: | wordpresssites | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Users | Keywords: | close |
Focuses: | Cc: |
Description ¶
Something like has_gravatar
would be a good function/conditional to check if the user has a Gravatar account otherwise you could set a fallback using code.
Ar present, the only way is to use all this code https://codex.wordpress.org/Using_Gravatars#Checking_for_the_Existence_of_a_Gravatar
Pull Requests
- Loading…
Note: See
TracTickets for help on using
tickets.
The
get_avatar()
/get_avatar_data()
function defaults to use Gravatar, though any plugin can override this. So just checking if a user has a Gravatar would not work. Also, since it's not actually needed in core there's not really an urge to implement this. Just add the suggested function from the codex in your plugin.If you want a fallback for the case a Gravatar does not exist, simply override the default param, e.g. by filtering the
avatar_default
option.For example, this will load the specified fallback URL:
http://www.gravatar.com/avatar/someuser?d=<fallback-url>&s=512