Group_Meta::add_metadata( int $object_id, string $meta_key, mixed $meta_value, bool $unique = false )

Wrapper method for add_metadata that can be overridden in sub classes.


Parameters Parameters

$object_id

(int) (Required) ID of the object the metadata is for.

$meta_key

(string) (Required) Metadata key to use.

$meta_value

(mixed) (Required) Metadata value. Must be serializable if non-scalar.

$unique

(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

(int|false) The meta ID on success, false on failure.


Source Source

File: cli/src/group-meta.php

	protected function add_metadata( $object_id, $meta_key, $meta_value, $unique = false ) {
		return groups_add_groupmeta( $object_id, $meta_key, $meta_value );
	}


Top ↑

User Contributed Notes User Contributed Notes

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