Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

#2374 closed defect (bug) (fixed)

Pass $comment parameter for "bp_get_member_name" filter

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: 1.2.4 Priority: minor
Severity: Version:
Component: Activity Keywords: has-patch
Cc: r-a-y

Description

In BP 1.2.3, would help if the bp_get_member_name filter on line 578 in bp-activity/bp-activity-templatetags.php passed the $comment variable.

Change:

$content .= '<div class="acomment-meta"><a href="' . bp_core_get_user_domain( $comment->user_id, $comment->user_nicename, $comment->user_login ) . '">' . apply_filters( 'bp_get_member_name', $comment->user_fullname ) . '</a> &middot; ' . sprintf( ( '%s ago', 'buddypress' ), bp_core_time_since( strtotime( $comment->date_recorded ) ) );

to:

$content .= '<div class="acomment-meta"><a href="' . bp_core_get_user_domain( $comment->user_id, $comment->user_nicename, $comment->user_login ) . '">' . apply_filters( 'bp_get_member_name', $comment->user_fullname, $comment ) . '</a> &middot; ' . sprintf( __( '%s ago', 'buddypress' ), bp_core_time_since( strtotime( $comment->date_recorded ) ) );

Attachments (1)

2374.patch (1.3 KB) - added by r-a-y 12 years ago.

Download all attachments as: .zip

Change History (5)

#1 @r-a-y
12 years ago

Just found out that the bp_get_member_name filter already exists in the bp_get_member_name() function (on line 254 in bp-core-templatetags.php) and it only accepts one argument.

So one additional change must be made here:

return apply_filters( 'bp_get_member_name', $members_template->member->fullname, null );

---

I realize this is not the right way to go about this, so instead, I'd like to propose renaming the filter on line 578 in bp-activity/bp-activity-templatetags.php to something like:

apply_filters( 'bp_acomment_name', $comment->user_fullname, $comment )

#2 @r-a-y
12 years ago

  • Cc r-a-y added

@r-a-y
12 years ago

#3 @r-a-y
12 years ago

  • Keywords has-patch added

#4 @apeatling
12 years ago

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

(In [3014]) Fixes #2374 props r-a-y

Note: See TracTickets for help on using tickets.