WC_Helper::has_product_subscription
Checks whether current site has product subscription of a given ID.
Method of the class: WC_Helper{}
No Hooks.
Returns
true|false. Returns true if product subscription exists, false otherwise.
Usage
$result = WC_Helper::has_product_subscription( $product_id );
- $product_id(int) (required)
- The product id.
Changelog
| Since 3.7.0 | Introduced. |
WC_Helper::has_product_subscription() WC Helper::has product subscription code WC 10.8.1
public static function has_product_subscription( $product_id ) {
$subscription = self::_get_subscriptions_from_product_id( $product_id, true );
return ! empty( $subscription );
}