Title: Overriding a filter
Last modified: January 22, 2019

---

# Overriding a filter

 *  Resolved [Pradeep](https://wordpress.org/support/users/pmaheepala/)
 * (@pmaheepala)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/overriding-a-filter/)
 * Hello there,
 * Great plugin! I do have a query though. Is there any way that I can override 
   this filer using functions.php?
 * `add_filter('woocommerce_my_account_my_orders_actions', array($this, 'add_wc_cancel_my_account_orders_status'),
   100, 2);`
 * I saw the answer given in [here ](https://wordpress.org/support/topic/ovveride-function/)
   but that doesn’t work.
 * Many thanks in advance!

Viewing 1 replies (of 1 total)

 *  Thread Starter [Pradeep](https://wordpress.org/support/users/pmaheepala/)
 * (@pmaheepala)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/overriding-a-filter/#post-11118227)
 * It’s OK. I just figured out thanks to [this article](https://mekshq.com/remove-wordpress-action-filter-class/).
   For anyone who would like to do the same in future, here’s what I did.
 *     ```
       function remove_wc_cancel_order_filter()
       {
          global $cancel_order;
          remove_filter('woocommerce_my_account_my_orders_actions', array($cancel_order, 'add_wc_cancel_my_account_orders_status'), 100, 2);
       }
       add_action('after_setup_theme', 'remove_wc_cancel_order_filter');
   
       add_filter('woocommerce_my_account_my_orders_actions', 'your_function_name', 999, 2);
       function your_function_name($actions, $order)
       {
         //Your code
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Overriding a filter’ is closed to new replies.

 * ![](https://ps.w.org/wc-cancel-order/assets/icon-256x256.png?rev=2763289)
 * [WC Cancel Order](https://wordpress.org/plugins/wc-cancel-order/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wc-cancel-order/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wc-cancel-order/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-cancel-order/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-cancel-order/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-cancel-order/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Pradeep](https://wordpress.org/support/users/pmaheepala/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/overriding-a-filter/#post-11118227)
 * Status: resolved