WC_Product_Data_Store_CPT::get_shipping_class_id_by_slug( string $slug )
Get shipping class ID by slug.
Description Description
Parameters Parameters
- $slug
-
(Required) Product shipping class slug.
Return Return
(int|false)
Source Source
File: includes/data-stores/class-wc-product-data-store-cpt.php
public function get_shipping_class_id_by_slug( $slug ) { $shipping_class_term = get_term_by( 'slug', $slug, 'product_shipping_class' ); if ( $shipping_class_term ) { return $shipping_class_term->term_id; } else { return false; } }
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |