Browse: Home / Classes / Learndash_WooCommerce /

Learndash_WooCommerce::is_subscription_product

Learndash_WooCommerce::is_subscription_product( WC_Product $product )

Checks whether a product is a subscription of any kind.


Description #

Access granted by a subscription follows the subscription’s own status rather than the status of the orders behind it, so subscription products are kept out of the order based access handlers. A variable subscription reaches those handlers as a subscription_variation line item, and its parent as variable-subscription, so the type cannot be compared to subscription on its own.


Parameters #

$product

(WC_Product) (Required) WooCommerce product object.


Return #

(bool) True when the product is a subscription of any type, false otherwise.


Source #

File: includes/woocommerce/includes/class-learndash-woocommerce.php


Changelog #

Changelog
Version Description
5.2.0 Introduced.