WC_Product_Variation_Data_Store_CPT::update_guid()
Update product variation guid.
Method of the class: WC_Product_Variation_Data_Store_CPT{}
No Hooks.
Return
null
. Nothing (null).
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. |
WC_Product_Variation_Data_Store_CPT::update_guid() WC Product Variation Data Store CPT::update guid code WC 9.2.3
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() ) ); }