Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Woocommerce remove an action hook

I am using woocommerce plugin in my wordpress site. I want to remove a function named 'woocommerce_checkout_coupon_form' which is hooked in to the action 'woocommerce_before_checkout_form'.

I tried adding the below code in my theme functions.php

add_action('init','remove_coupon_text',10);
function remove_coupon_text() {
    remove_action('woocommerce_before_checkout_form','woocommerce_checkout_login_form',10);
} 

But this is not working. Any idea?

like image 818
Pramod Sivadas Avatar asked Mar 17 '15 12:03

Pramod Sivadas


2 Answers

Sorry it was a mistake from my side. I used the wrong function name. The function name I intended to remove was 'woocommerce_checkout_coupon_form'. The issue is fixed now.

like image 97
Pramod Sivadas Avatar answered Oct 30 '22 05:10

Pramod Sivadas


Try this

remove_all_actions( $tag, $priority );
like image 30
Bikram Shrestha Avatar answered Oct 30 '22 03:10

Bikram Shrestha