Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/25/2022 01:37:47 PM (3 years ago)
Author:
imath
Message:

Clear the user notification cache when bulk marking as unread items

Props oztaser, niftythree

See #8642 (trunk)

File:
1 edited

Legend:

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

    r13243 r13247  
    105105        // Get the list of user IDs from notification IDs.
    106106    } elseif ( isset( $where_args['ids'] ) && $where_args['ids'] ) {
    107         $ids = (array) $where_args['ids'];
     107        $ids    = (array) $where_args['ids'];
     108        $is_new = 1;
     109
     110        if ( isset( $update_args['data']['is_new'] ) && 1 === $update_args['data']['is_new'] ) {
     111            $is_new = 0;
     112        }
    108113
    109114        $ns = BP_Notifications_Notification::get(
    110115            array(
    111                 'id' => $ids,
     116                'id'      => $ids,
     117                'is_new'  => $is_new,
    112118            )
    113119        );
Note: See TracChangeset for help on using the changeset viewer.