[buddypress-trac] [BuddyPress Trac] #7020: bp_notifications_get_notifications_for_user() bug

buddypress-trac noreply at wordpress.org
Fri Apr 15 21:57:52 UTC 2016


#7020: bp_notifications_get_notifications_for_user() bug
--------------------------+------------------
 Reporter:  rogercoathup  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.6
Component:  API           |     Version:  1.9
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+------------------
Changes (by r-a-y):

 * keywords:   => dev-feedback
 * version:  2.5.0 => 1.9
 * milestone:  Awaiting Review => 2.6


Comment:

 Related: #6669, #bbPress2665.

 The `'bp_notifications_get_notifications_for_user'` filter is quite weird
 indeed.  You either have to return a string of the content or `array(
 'text' => 'CONTENT', 'link' => 'LINK' )` depending on the `$format`.  I
 think this needs better documentation.

 Since this filter was introduced in BP 1.9, I'm not sure if we can make
 this filter any better since other plugins are already using it such as
 bbPress.

 Personally, I would not recommend using this filter.  Instead, read the
 latter half of comment:4:ticket:6669 for an alternative approach to
 formatting your custom notifications.

 ----

 If you are trying to use this filter to modify notifications written by
 other plugins using this filter, then we probably need to add some
 additional parameters so the action is passed again for better checks:

 {{{#!php
 <?php
 $ref_array = array(
         $component_action_name,
         $component_action_items[0]->item_id,
         $component_action_items[0]->secondary_item_id,
         $action_item_count,
         $format,
         $component_action_name, // Duplicate this since this could be
 changed by plugins.
         $component_name,        // Component name is a good parameter to
 do checks against as well.
 );
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7020#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list