• Resolved Pradeep

    (@pmaheepala)


    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 but that doesn’t work.

    Many thanks in advance!

Viewing 1 replies (of 1 total)
  • Thread Starter Pradeep

    (@pmaheepala)

    It’s OK. I just figured out thanks to this article. 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.