wc_get_product_id_by_global_unique_id()
Get product ID by Unique ID.
No Hooks.
Return
Int|null
.
Usage
wc_get_product_id_by_global_unique_id( $global_unique_id );
- $global_unique_id(string) (required)
- Product Unique ID.
Changelog
Since 9.1.0 | Introduced. |
wc_get_product_id_by_global_unique_id() wc get product id by global unique id code WC 9.3.1
function wc_get_product_id_by_global_unique_id( $global_unique_id ) { $data_store = WC_Data_Store::load( 'product' ); if ( $data_store->has_callable( 'get_product_id_by_global_unique_id' ) ) { return $data_store->get_product_id_by_global_unique_id( $global_unique_id ); } else { $logger = wc_get_logger(); $logger->error( 'The method get_product_id_by_global_unique_id is not implemented in the data store.', array( 'source' => 'wc_get_product_id_by_global_unique_id' ) ); } return null; }