bp_notifications_update_meta_cache( int|string|array|bool $notification_ids = false )

Slurp up metadata for a set of notifications.

Description

It grabs all notification meta associated with all of the notifications passed in $notification_ids and adds it to WP cache. This improves efficiency when using notification meta within a loop context.

Parameters

$notification_ids

(int|string|array|bool) (Optional) Accepts a single notification_id, or a comma-separated list or array of notification ids.

Default value: false

Source

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

function bp_notifications_update_meta_cache( $notification_ids = false ) {
	bp_update_meta_cache( array(
		'object_ids'       => $notification_ids,
		'object_type'      => buddypress()->notifications->id,
		'cache_group'      => 'notification_meta',
		'object_column'    => 'notification_id',
		'meta_table'       => buddypress()->notifications->table_name_meta,
		'cache_key_prefix' => 'bp_notifications_meta'
	) );
}

Changelog

Changelog
Version Description
BuddyPress 2.3.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.