[buddypress-trac] [BuddyPress Trac] #6971: Params for bp_get_activity_content_body filter should be the same whatever the context

buddypress-trac noreply at wordpress.org
Mon Mar 21 23:02:28 UTC 2016


#6971: Params for bp_get_activity_content_body filter should be the same whatever
the context
----------------------------------+-----------------------------
 Reporter:  imath                 |      Owner:
     Type:  defect (bug)          |     Status:  new
 Priority:  normal                |  Milestone:  Awaiting Review
Component:  Component - Activity  |    Version:
 Severity:  normal                |   Keywords:
----------------------------------+-----------------------------
 In `bp-activity-template.php` it's :
 `apply_filters_ref_array( 'bp_get_activity_content_body', array(
 $activities_template->activity->content, &$activities_template->activity )
 )`

 2 arguments:  the content + the full activity object

 In bp-legacy/buddypress-functions.php it's
 `apply_filters( 'bp_get_activity_content_body', $activity->content )`

 1 argument the content only

 In `bp-activity-notifications.php` it's
 `apply_filters( 'bp_get_activity_content_body', $params['content'] ); ``

 1 argument the content only

 And in `class-bp-activity-list-table.php` it's
 `apply_filters_ref_array( 'bp_get_activity_content_body', array(
 $item['content'] ) )`

 1 argument the content only.

 As soon as you only need the content, it's ok. But if you need the full
 activity object to check for additional properties, it's a nightmare!

 The filter should always include 2 params imho.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6971>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list