WC_Data_Store_WP::add_meta( WC_Data $object, stdClass $meta )

Add new piece of meta.


Description Description


Parameters Parameters

$object

(Required) WC_Data object.

$meta

(Required) (containing ->key and ->value).


Top ↑

Return Return

(int) meta ID


Top ↑

Source Source

File: includes/data-stores/class-wc-data-store-wp.php

	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 );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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