WordPress at Your Fingertips
function is not described

WC_Product_Variation_Data_Store_CPT::update_guid() protected WC 3.6.0

Update product variation guid.

{} 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_guid( $product );
$product(WC_Product_Variation) (required)
Product variation object.

Changelog

Since 3.6.0 Introduced.

Code of WC_Product_Variation_Data_Store_CPT::update_guid() WC 5.6.0

protected function update_guid( $product ) {
	global $wpdb;

	$guid = home_url(
		add_query_arg(
			array(
				'post_type' => 'product_variation',
				'p'         => $product->get_id(),
			),
			''
		)
	);
	$wpdb->update( $wpdb->posts, array( 'guid' => $guid ), array( 'ID' => $product->get_id() ) );
}