WC_Product_Importer::set_meta_data()
Append meta data.
Method of the class: WC_Product_Importer{}
No Hooks.
Return
null
. Nothing.
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() WC Product Importer::set meta data code WC 7.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'] ); } } }