Skip to:
Content

Opened 3 years ago

Closed 3 years ago

#2697 closed enhancement (fixed)

Make it easier to shut off Gravatar

Reported by: boonebgorges Owned by: boonebgorges
Milestone: 1.5 Priority: minor
Severity: Version:
Component: Core Keywords:
Cc: westi

Description

Related: #2367

Currently it's possible to disable Gravatar lookups by feeding no_grav=true to bp_core_fetch_avatar. However, bp_core_fetch_avatar() is called in many places throughout BuddyPress, so anyone who wants to disable Gravatar has to jump through a ton of hoops to make it work right.

A global constant, that when defined sets no_grav to true, would be an easy-to-implement solution. A similar check might have to happen in the signup avatar functions, and in the group creation process.

Attachments (1)

2697-1.patch (1.2 KB) - added by boonebgorges 3 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 westi3 years ago

  • Cc westi added

Rather than a global constant a better way is just to pass the $no_grav value through a filter here:

https://trac.buddypress.org/browser/trunk/bp-core/bp-core-avatars.php#L210

e.g.

if ( ! apply_filters( 'bp_core_fetch_avatar_no_grav', $no_grav ) {

boonebgorges3 years ago

comment:2 boonebgorges3 years ago

Good call. Here's a first go at a patch that provides just such a filter, and also lets the admin filter the default avatar location based on what kind of avatar it is.

Related: #2712

comment:3 djpaul3 years ago

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

(In [3699]) Add filter to allow gravatar lookups to be disabled site-wide. Fixes #2697, props boonebgorges for initial patch.

Note: See TracTickets for help on using tickets.