Skip to:
Content

BuddyPress.org

Changeset 7532


Ignore:
Timestamp:
11/08/2013 05:38:58 AM (11 years ago)
Author:
johnjamesjacoby
Message:

Add $is_new to bp_notifications_add_notification(), allowing developers to add notifications to the log without requiring user intervention. See #5148.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-notifications.php

    r7531 r7532  
    2424 * @param string $secondary_item_id
    2525 * @param string $date_notified
    26  * @return boolean True on success, false on fail
    27  */
    28 function bp_core_add_notification( $item_id, $user_id, $component_name, $component_action, $secondary_item_id = 0, $date_notified = false ) {
     26 * @param string $is_new
     27 * @return boolean True on success, false on fail
     28 */
     29function bp_core_add_notification( $item_id, $user_id, $component_name, $component_action, $secondary_item_id = 0, $date_notified = false, $is_new = true ) {
    2930
    3031    // Bail if notifications is not active
     
    3940        'component_action'  => $component_action,
    4041        'secondary_item_id' => $secondary_item_id,
    41         'date_notified'     => $date_notified
     42        'date_notified'     => $date_notified,
     43        'is_new'            => $is_new
    4244    );
    4345
  • trunk/bp-notifications/bp-notifications-functions.php

    r7529 r7532  
    4242        'component_action'  => '',
    4343        'date_notified'     => bp_core_current_time(),
     44        'is_new'            => 1
    4445    ) );
    4546
     
    5253    $notification->component_action  = $r['component_action'];
    5354    $notification->date_notified     = $r['date_notified'];
    54     $notification->is_new            = 1;
     55    $notification->is_new            = $r['is_new'];
    5556
    5657    // Save the new notification
Note: See TracChangeset for help on using the changeset viewer.