bp_notifications_clear_all_for_user_cache_before_delete( int $args )
Invalidate the ‘all_for_user_’ cache when deleting.
Description Description
Parameters Parameters
- $args
-
(Required) Notification deletion arguments.
Source Source
File: bp-notifications/bp-notifications-cache.php
function bp_notifications_clear_all_for_user_cache_before_delete( $args ) { // Pull up a list of items matching the args (those about te be deleted). $ns = BP_Notifications_Notification::get( $args ); $user_ids = array(); foreach ( $ns as $n ) { $user_ids[] = $n->user_id; } $user_ids = array_unique( $user_ids ); foreach ( $user_ids as $user_id ) { bp_notifications_clear_all_for_user_cache( $user_id ); } }
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |