groups_update_groupmeta( int $group_id, string $meta_key, mixed $meta_value, mixed $prev_value = '' )

Update a piece of group metadata.

Parameters Parameters


(int) (Required) ID of the group.


(string) (Required) Metadata key.


(mixed) (Required) Value to store.


(mixed) (Optional) If specified, only update existing metadata entries with the specified value. Otherwise, update all entries.

Default value: ''

Top ↑

Return Return

(bool|int) $retval Returns false on failure. On successful update of existing metadata, returns true. On successful creation of new metadata, returns the integer ID of the new metadata row.

Source Source

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

function groups_update_groupmeta( $group_id, $meta_key, $meta_value, $prev_value = '' ) {
	add_filter( 'query', 'bp_filter_metaid_column_name' );
	$retval = update_metadata( 'group', $group_id, $meta_key, $meta_value, $prev_value );
	remove_filter( 'query', 'bp_filter_metaid_column_name' );

	return $retval;

Top ↑

Changelog Changelog

Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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