trogdoor84
trogdoor84

Reputation: 45

Remove an action - Wordpress (Specifically Woocommerce PIP plugin)

I have Woocommerce website with the plugin Print Invoices/Packing Lists installed.

I'm trying to remove an action and I've narrowed down the action to this (shortened) code;

class WC_PIP_Document_Invoice extends WC_PIP_Document {
    public function __construct( array $args ) {
        parent::__construct( $args );

        // add a "View Invoice" link on order processing/complete emails sent to customer
        add_action( 'woocommerce_email_order_meta', array( $this, 'order_paid_email_view_invoice_link' ), 40, 3 );
    }
}

So I'm looking at removing this using; https://codex.wordpress.org/Function_Reference/remove_action

However as the action as added within a class, I can't quite work out what to pass into the function name. Would it be something like;

remove_action( 'woocommerce_email_order_meta', array( 'WC_PIP_Document_Invoice', 'order_paid_email_view_invoice_link' ), 40 );

Can anyone point me in the right direction?

Many thanks

Upvotes: 1

Views: 199

Answers (1)

dipmala
dipmala

Reputation: 2011

Try following code that should work for you.

add_action( 'init', 'wpse_106269_remove_hooks', 11 );
function wpse_106269_remove_hooks(){
    remove_action( 'woocommerce_email_order_meta', 'action_woocommerce_email_order_meta', 10, 4 ); 
 }

Upvotes: 1

Related Questions