[buddypress-trac] [BuddyPress Trac] #6669: Blank notifications when using the bp_notifications_get_notifications_for_user filter hook

buddypress-trac noreply at wordpress.org
Wed Nov 11 20:03:11 UTC 2015


#6669: Blank notifications when using the
bp_notifications_get_notifications_for_user filter hook
---------------------------------------+-----------------------
 Reporter:  henry.wright               |       Owner:
     Type:  defect (bug)               |      Status:  reopened
 Priority:  normal                     |   Milestone:
Component:  Component - Notifications  |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:                             |
---------------------------------------+-----------------------
Changes (by likebtn):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 Guys, this seems to be a bug.

 More than one "bp_notifications_get_notifications_for_user" filter will
 never work.

 In /wp-content/plugins/buddypress/bp-notifications/bp-notifications-
 template.php:

 {{{#!php
 <?php
 $description = apply_filters_ref_array(
 'bp_notifications_get_notifications_for_user', array(
 $notification->component_action, $notification->item_id,
 $notification->secondary_item_id, 1 ) );
 }}}

 In /wp-includes/plugin.php:

 {{{#!php
 <?php
 do {
         foreach( (array) current($wp_filter[$tag]) as $the_ )
                 if ( !is_null($the_['function']) )
                         $args[0] = call_user_func_array($the_['function'],
 array_slice($args, 0, (int) $the_['accepted_args']));

 } while ( next($wp_filter[$tag]) !== false );
 }}}


 apply_filters_ref_array() function calls callback functions and return
 value of the first callback is passed as the first argument of the second.
 For example if "bbp_format_buddypress_notifications" function returns
 nothing our own "bp_notifications_get_notifications_for_user" callback
 function receives an empty first "action" parameter.

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


More information about the buddypress-trac mailing list