Ticket #7066: 7066.01.patch
File 7066.01.patch, 3.6 KB (added by , 9 years ago) |
---|
-
src/bp-notifications/bp-notifications-functions.php
233 233 $component_action_items[0]->item_id, 234 234 $component_action_items[0]->secondary_item_id, 235 235 $action_item_count, 236 'array' 236 'array', 237 $component_action_items[0]->id 237 238 ); 238 239 239 240 // Create the object to be returned. … … 253 254 254 255 // Return an array of content strings. 255 256 } else { 256 $content = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count );257 $content = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count, $component_action_items[0]->id ); 257 258 $renderable[] = $content; 258 259 } 259 260 … … 272 273 $action_item_count, 273 274 $format, 274 275 $component_action_name, // Duplicated so plugins can check the canonical action name. 275 $component_name 276 $component_name, 277 $component_action_items[0]->id 276 278 ); 277 279 278 280 // Function should return an object. … … 296 298 * @param string $format Format of return. Either 'string' or 'object'. 297 299 * @param string $component_action_name Canonical notification action. 298 300 * @param string $component_name Notification component ID. 301 * @param int $id Notification ID. 299 302 * 300 303 * @return string|array If $format is 'string', return a string of the notification content. 301 304 * If $format is 'object', return an array formatted like: -
src/bp-notifications/bp-notifications-template.php
469 469 470 470 // Callback function exists. 471 471 if ( isset( $bp->{ $notification->component_name }->notification_callback ) && is_callable( $bp->{ $notification->component_name }->notification_callback ) ) { 472 $description = call_user_func( $bp->{ $notification->component_name }->notification_callback, $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1 );472 $description = call_user_func( $bp->{ $notification->component_name }->notification_callback, $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1, 'string', $notification->id ); 473 473 474 474 // @deprecated format_notification_function - 1.5 475 475 } elseif ( isset( $bp->{ $notification->component_name }->format_notification_function ) && function_exists( $bp->{ $notification->component_name }->format_notification_function ) ) { … … 479 479 } else { 480 480 481 481 /** This filter is documented in bp-notifications/bp-notifications-functions.php */ 482 $description = apply_filters_ref_array( 'bp_notifications_get_notifications_for_user', array( $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1, 'string', $notification->component_action, $notification->component_name ) );482 $description = apply_filters_ref_array( 'bp_notifications_get_notifications_for_user', array( $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1, 'string', $notification->component_action, $notification->component_name, $notification->id ) ); 483 483 } 484 484 485 485 /**