WC_Product_Importer::set_meta_data()protectedWC 1.0

Append meta data.

Method of the class: WC_Product_Importer{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->set_meta_data( $product, $data );
$product(WC_Product) (required) (passed by reference — &)
Product instance.
$data(array) (required)
Item data.

WC_Product_Importer::set_meta_data() code WC 8.7.0

protected function set_meta_data( &$product, $data ) {
	if ( isset( $data['meta_data'] ) ) {
		foreach ( $data['meta_data'] as $meta ) {
			$product->update_meta_data( $meta['key'], $meta['value'] );
		}
	}
}