Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#30639 closed enhancement (duplicate)

get_avatar custom image classes

Reported by: tigusigalpa's profile tigusigalpa Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0.1
Component: General Keywords:
Focuses: ui Cc:


Hi, guys!
I just think we need to allow add a new classes to image returned by get_avatar() function at /wp-includes/pluggable.php. So my solution is to add something like


so the final code is:

$avatar = "<img alt='{$safe_alt}' src='{$out}' class='avatar avatar-{$size} photo";
$avatar .= "' height='{$size}' width='{$size}' />";

I think it will helps for theme developers to customize avatar image.

Change History (2)

#1 @tigusigalpa
10 years ago

  • Keywords dev-feedback added

Or we can add new filter for avatar classes, i think it will be more productive)

#2 @SergeyBiryukov
10 years ago

  • Component changed from Formatting to General
  • Focuses template removed
  • Keywords dev-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Summary changed from get_avatar cusom image classes to get_avatar custom image classes
  • Type changed from feature request to enhancement

Duplicate of #27336.

Note: See TracTickets for help on using tickets.