WordPress at Your Fingertips
function is not described

WC_Data_Store_WP::add_meta() public WC 3.0.0

Add new piece of meta.

{} It's a method of the class: WC_Data_Store_WP{}

No Hooks.

Return

Int. meta ID

Usage

$WC_Data_Store_WP = new WC_Data_Store_WP();
$WC_Data_Store_WP->add_meta( $object, $meta );
$object(WC_Data) (required) (passed by reference — &)
WC_Data object.
$meta(stdClass) (required)
(containing ->key and ->value).

Changelog

Since 3.0.0 Introduced.

Code of WC_Data_Store_WP::add_meta() WC 5.7.1

public function add_meta( &$object, $meta ) {
	return add_metadata( $this->meta_type, $object->get_id(), wp_slash( $meta->key ), is_string( $meta->value ) ? wp_slash( $meta->value ) : $meta->value, false );
}