Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#34744 closed defect (bug) (fixed)

Don't use regex replacement to set force_default to true for images under Settings > Discussion > Default Avatar

Reported by: henry.wright Owned by: swissspidy
Priority: normal Milestone: 4.6
Component: Administration Version: 4.2
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

Now that get_avatar() accepts a 5th param, we should use it to set force_default instead of using preg_replace(). Patch to follow...

Attachments (2)

34744.diff (1.3 KB ) - added by henry.wright 11 years ago.
34744.2.diff (1.3 KB ) - added by swissspidy 11 years ago.

Download all attachments as: .zip

Change History (12)

@henry.wright
11 years ago

#1 @henry.wright
11 years ago

  • Keywords has-patch added

#2 @swissspidy
11 years ago

  • Milestone Awaiting ReviewFuture Release

#3 @henry.wright
11 years ago

I should mention this will help fix BuddyPress ticket 6298.

Ref: https://buddypress.trac.wordpress.org/ticket/6298.

Last edited 11 years ago by henry.wright (previous) (diff)

#4 @swissspidy
11 years ago

  • Milestone Future Release4.5
  • Owner set to swissspidy
  • Status newreviewing
  • Type enhancementdefect (bug)
  • Version 4.3.14.2

@swissspidy
11 years ago

#5 @swissspidy
11 years ago

Note: The resulting HTML, which is being filtered in default_avatar_select, changes slightly using this patch. Instead of appending forcedefault=1 to the URL, it contains &f=y.

Not a big deal, but I'm not sure if it's big enough to skip for 4.5

#6 @henry.wright
11 years ago

According to Grav, either f or forcedefault can be used as the param:

https://en.gravatar.com/site/implement/images/#force-default

#7 @swissspidy
11 years ago

  • Milestone 4.5Future Release

#8 @swissspidy
10 years ago

  • Milestone Future Release4.6

#9 @swissspidy
10 years ago

  • Keywords commit added

#10 @swissspidy
10 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 37227:

Admin: Fix default avatar handling in Settings -> Discussion.

By passing the force_default argument to get_avatar() instead of using preg_replace, we make it easier for developers to override the output.

Props henry.wright.
Fixes #34744.

Note: See TracTickets for help on using tickets.