WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 6 months 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:
PR Number:

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
4 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
4 years ago

  • Version trunk deleted

#3 @wpscholar
6 months 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.