Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Please review my code to prevent debit transaction emails

$
0
0

Replies: 0

Hi,

I would like to prevent debit transaction emails on my site.

Kindly review my code below to confirm that it is fine.

    /**
	 * Prevent debit transaction emails.
	 */    
add_filter( 'woocommerce_email_recipient_new_wallet_transaction', 'prevent_debit_email, 10, 3 );
    function prevent_debit_email( $recipient, $user, $transaction ) {
        if ( $transaction->type === 'debit' ) {
            return false;
        }
        return $recipient;
    }

Thanks a lot.
Sadiq


Viewing all articles
Browse latest Browse all 59525

Trending Articles