• I want to add cancel button on my account, next to my ‘on-hold’ status orders

    I use:

    add_filter ('woocommerce_valid_order_statuses_for_cancel', 'my_valid_order_status');
    function my_valid_order_status($a){
    $a=array('pending','failed','on-hold');
    return $a;
    }

    but no vail

    I use:
    add_filter ('woocommerce_valid_order_statuses_for_cancel', array('pending','failed','on-hold'))

    not working either.

    Anyone can help?

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    The filter is fine, but it depends where you put it.. Would need to be in theme functions.php to be in place early enough.

Viewing 1 replies (of 1 total)
  • The topic ‘Why this add_filter doesn't work?’ is closed to new replies.