Title: Status active subscriptions
Last modified: March 27, 2023

---

# Status active subscriptions

 *  Resolved [valousal](https://wordpress.org/support/users/valentinanamorphik/)
 * (@valentinanamorphik)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/status-active-subscriptions/)
 * Hi,
 * Why is a subscription with “CANCELLED” status considered an active subscription?
 *     ```wp-block-code
           public function get_active_subscriptions($include_trial = true)
           {
               $statuses = [
                   SubscriptionStatus::ACTIVE,
                   SubscriptionStatus::COMPLETED,
                   SubscriptionStatus::CANCELLED
               ];
   
               if ($include_trial) $statuses[] = SubscriptionStatus::TRIALLING;
   
               $subs = $this->get_subscriptions($statuses);
   
               $result = [];
   
               if ( ! empty($subs)) {
   
                   foreach ($subs as $sub) {
                       if ($sub->is_active() && ! $sub->is_expired()) $result[] = $sub;
                   }
               }
   
               return $result;
           }
       ```
   
 * Is it possible to add a filter on the “_get\_active\_subscriptions_” ?
 *     ```wp-block-code
       apply_filters('ppress_status_active_subscriptions', $statuses);
       ```
   
 * Thanks.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Collins Agbonghama](https://wordpress.org/support/users/collizo4sky/)
 * (@collizo4sky)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/status-active-subscriptions/#post-16599468)
 * Say a user subscribe to a yearly membership plan. After purchase, they decided
   they dont want the subscription to auto-renew, they can cancel their subscription
   but that doesn’t mean the subscription is not active. The subscription becomes
   inactive after it expires.
 * We’ve added the following filter that will be in the next plugin update
 *     ```wp-block-code
       apply_filters('ppress_customer_active_subscriptions', $result, $this);
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Status active subscriptions’ is closed to new replies.

 * ![](https://ps.w.org/wp-user-avatar/assets/icon-256x256.png?rev=2532486)
 * [Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress](https://wordpress.org/plugins/wp-user-avatar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-user-avatar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-user-avatar/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-user-avatar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-user-avatar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-user-avatar/reviews/)

## Tags

 * [request](https://wordpress.org/support/topic-tag/request/)

 * 1 reply
 * 2 participants
 * Last reply from: [Collins Agbonghama](https://wordpress.org/support/users/collizo4sky/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/status-active-subscriptions/#post-16599468)
 * Status: resolved