WC_Post_Data::clear_global_unique_id_if_necessary()
Clear global unique id if it's not unique.
Method of the class: WC_Post_Data{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = WC_Post_Data::clear_global_unique_id_if_necessary( $id );
- $id(mixed) (required)
- Post ID.
WC_Post_Data::clear_global_unique_id_if_necessary() WC Post Data::clear global unique id if necessary code WC 9.3.1
private static function clear_global_unique_id_if_necessary( $id ) { $product = wc_get_product( $id ); if ( $product && ! wc_product_has_global_unique_id( $id, $product->get_global_unique_id() ) ) { $product->set_global_unique_id( '' ); $product->save(); } }