Skip to:
Content

BuddyPress.org

Changeset 8745


Ignore:
Timestamp:
07/31/2014 06:07:51 PM (11 years ago)
Author:
johnjamesjacoby
Message:

In bp_notifications_get_notifications_for_user() set the $notification_object as the $component_action_item[0] object rather than an empty stdClass. This maintains backwards compatibility with existing functionality, while allowing groups of notifications to have a bit more metadata to play with on output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-notifications/bp-notifications-functions.php

    r8744 r8745  
    223223
    224224                    // Create the object to be returned
    225                     $notification_object = new stdClass;
     225                    $notification_object = $component_action_items[0];
    226226
    227227                    // Minimal backpat with non-compatible notification
     
    235235                    }
    236236
    237                     $notification_object->id = $component_action_items[0]->id;
    238                     $renderable[]            = $notification_object;
     237                    $renderable[] = $notification_object;
    239238
    240239                // Return an array of content strings
     
    267266
    268267                    // Create the object to be returned
    269                     $notification_object = new stdClass;
     268                    $notification_object = $component_action_items[0];
    270269
    271270                    // Minimal backpat with non-compatible notification
     
    279278                    }
    280279
    281                     $notification_object->id = $component_action_items[0]->id;
    282                     $renderable[]            = $notification_object;
     280                    $renderable[] = $notification_object;
    283281
    284282                // Return an array of content strings
Note: See TracChangeset for help on using the changeset viewer.