WC_Helper::has_product_subscription() public WC 3.7.0
Checks whether current site has product subscription of a given ID.
{} Это метод класса: WC_Helper{}
Хуков нет.
Возвращает
true/false. Returns true if product subscription exists, false otherwise.
Использование
$result = WC_Helper::has_product_subscription( $product_id );
- $product_id(число) (обязательный)
- The product id.
Список изменений
С версии 3.7.0 | Введена. |
Код WC_Helper::has_product_subscription() WC Helper::has product subscription WC 5.0.0
public static function has_product_subscription( $product_id ) {
$subscription = self::_get_subscriptions_from_product_id( $product_id, true );
return ! empty( $subscription );
}