bp_messages_update_meta_cache( int|string|array|bool $message_ids = false )

Slurp up metadata for a set of messages.

Description

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

Parameters

$message_ids

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

Default value: false

Source

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

function bp_messages_update_meta_cache( $message_ids = false ) {
	bp_update_meta_cache( array(
		'object_ids' 	   => $message_ids,
		'object_type' 	   => buddypress()->messages->id,
		'cache_group'      => 'message_meta',
		'object_column'    => 'message_id',
		'meta_table' 	   => buddypress()->messages->table_name_meta,
		'cache_key_prefix' => 'bp_messages_meta'
	) );
}

Changelog

Changelog
Version Description
BuddyPress 2.2.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.