#6622 closed defect (bug) (fixed)
Missed $args parameter in bp_core_fetch_avatar_filter()
Reported by: | WeddyWood | Owned by: | r-a-y |
---|---|---|---|
Milestone: | 2.4 | Priority: | high |
Severity: | normal | Version: | 2.3.0 |
Component: | Media | Keywords: | has-patch |
Cc: |
Description
$args parameter is missed in bp_core_fetch_avatar_filter() function, however this parameter exist in default get_avatar() WordPress function. Thus it is impossible to use class (for example) parameter for avatar.
Default WordPress get_avatar() function accept setting this $args parameter in filter:
apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
Therefore now bp_core_fetch_avatar_filter() function breaks default get_avatar behaviour.
Attachments (2)
Change History (10)
#1
@
9 years ago
- Keywords needs-patch good-first-bug added
- Milestone changed from Awaiting Review to 2.4
- Priority changed from normal to high
#2
@
9 years ago
- Keywords has-patch added; needs-patch removed
01.patch
is an initial pass at supporting the new $args
parameter in the 'get_avatar'
filter.
Something to be wary about is the $args['extra_attr']
parameter. WP does not sanitize this whatsoever. Do we want to do anything here?
This ticket was mentioned in Slack in #buddypress by boone. View the logs.
9 years ago
#4
@
9 years ago
- Keywords commit added
I don't think BuddyPress would have made that decision if we were implementing that, but as WordPress didn't and it is their filter, we shouldn't either.
I think your patch is fine. The only thing I suggest is to add a @since 2.4 Added $args parameter
on the bp_core_fetch_avatar_filter
function.
#5
@
9 years ago
- Keywords good-first-bug commit removed
- Version changed from 2.3.3 to 2.3.0
02.patch
is updated to include more parameters from WordPress 4.2.0:
https://core.trac.wordpress.org/browser/tags/4.3.1/src/wp-includes/pluggable.php#L2196
Just need a once-over before committing.
Hi WeddyWood
The
$args
parameter was added recently in WordPress 4.2, and it looks like no-one in BP noticed. We can add it in, sure. Thanks for pointing it out. :)