bp_messages_add_meta( int $message_id, string|bool $meta_key, string|bool $meta_value, bool $unique = false )

Add a piece of message metadata.

Description Description

See also See also

  • add_metadata(): for full documentation excluding $meta_type variable.

Top ↑

Parameters Parameters


(int) (Required) ID of the message to have meta deleted for.


(string|bool) (Required) Meta key to update.


(string|bool) (Required) Meta value to update.


(bool) (Optional) Whether the specified metadata key should be unique for the object. If true, and the object already has a value for the specified metadata key, no change will be made.

Default value: false

Top ↑

Return Return


Top ↑

Source Source

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

function bp_messages_add_meta( $message_id, $meta_key, $meta_value, $unique = false ) {
	add_filter( 'query', 'bp_filter_metaid_column_name' );
	$retval = add_metadata( 'message', $message_id, $meta_key, $meta_value, $unique );
	remove_filter( 'query', 'bp_filter_metaid_column_name' );

	return $retval;

Top ↑

Changelog Changelog

Version Description
2.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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