bp_notifications_clear_all_for_user_cache_before_update( array $update_args, array $where_args )

Invalidates ‘all_for_user_’ cache when updating.


Description Description


Parameters Parameters

$update_args

(Required) See BP_Notifications_Notification::update() for description.

$where_args

(Required) See BP_Notifications_Notification::update() for description.


Top ↑

Source Source

File: bp-notifications/bp-notifications-cache.php

function bp_notifications_clear_all_for_user_cache_before_update( $update_args, $where_args ) {

	// User ID is passed in where arugments.
	if ( ! empty( $where_args['user_id'] ) ) {
		bp_notifications_clear_all_for_user_cache( $where_args['user_id'] );

	// Get user ID from Notification ID.
	} elseif ( ! empty( $where_args['id'] ) ) {
		$n = bp_notifications_get_notification( $where_args['id'] );
		bp_notifications_clear_all_for_user_cache( $n->user_id );
	}
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.