Make WordPress Core

Opened 8 years ago

Closed 5 years ago

#35920 closed feature request (wontfix)

Function to check if user has a gravatar account

Reported by: wordpresssites's profile 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

Change History (3)

#1 @swissspidy
8 years ago

  • Keywords close added

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

#2 @chriscct7
8 years ago

  • Version trunk deleted

#3 @wpscholar
5 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Closing this ticket due to inactivity and in favor of the reasons mentioned by @swissspidy.

Note: See TracTickets for help on using tickets.