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

Slurp up metadata for a set of notifications.


Description 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 Parameters

$notification_ids

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

Default value: false


Top ↑

Source 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'
	) );
}

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.