WC_Product_Usage::get_product_usage_restriction_rule()
Get the product usage rule for a product.
Метод класса: WC_Product_Usage{}
Хуков нет.
Возвращает
Массив|null
.
Использование
$result = WC_Product_Usage::get_product_usage_restriction_rule( $product_id ): ?array;
- $product_id(int) (обязательный)
- product id to get feature restriction rules.
Список изменений
С версии 9.3.0 | Введена. |
Код WC_Product_Usage::get_product_usage_restriction_rule() WC Product Usage::get product usage restriction rule WC 9.4.2
private static function get_product_usage_restriction_rule( int $product_id ): ?array { $rules = WC_Helper::get_product_usage_notice_rules(); if ( empty( $rules['restricted_products'][ $product_id ] ) ) { return null; } return $rules['restricted_products'][ $product_id ]; }