$product_id ) ); if ( empty( $subscriptions ) ) { return new WC_Product_Usage_Rule_Set( $rules ); } // Product should only have a single connected subscription on current store. $product_subscription = current( $subscriptions ); if ( $product_subscription['expired'] ) { return new WC_Product_Usage_Rule_Set( $rules ); } return null; } /** * Get the product usage rule for a product. * * @param int $product_id product id to get feature restriction rules. * @return array|null * @since 9.3.0 */ 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 ]; } } WC_Product_Usage::load();