WordPress at Your Fingertips
function is not described

WC_Product_Variation_Data_Store_CPT::update_version_and_type() protected WC 3.0.0

Make sure we store the product version (to track data changes).

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->update_version_and_type( $product );
$product(WC_Product) (required) (passed by reference — &)
Product object.

Changelog

Since 3.0.0 Introduced.

Code of WC_Product_Variation_Data_Store_CPT::update_version_and_type() WC 5.7.0

protected function update_version_and_type( &$product ) {
	wp_set_object_terms( $product->get_id(), '', 'product_type' );
	update_post_meta( $product->get_id(), '_product_version', Constants::get_constant( 'WC_VERSION' ) );
}