WC_Product_Factory::get_product_type()
Get the product type for a product.
Метод класса: WC_Product_Factory{}
Хуки из метода
Возвращает
Строку|false
.
Использование
$result = WC_Product_Factory::get_product_type( $product_id );
- $product_id(int) (обязательный)
- Product ID.
Список изменений
С версии 3.0.0 | Введена. |
Код WC_Product_Factory::get_product_type() WC Product Factory::get product type WC 9.8.1
public static function get_product_type( $product_id ) { // Allow the overriding of the lookup in this function. Return the product type here. $override = apply_filters( 'woocommerce_product_type_query', false, $product_id ); if ( ! $override ) { return WC_Data_Store::load( 'product' )->get_product_type( $product_id ); } else { return $override; } }