Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thisissandip/ac37b3718a8c7513fa63588e5928858f to your computer and use it in GitHub Desktop.
Save thisissandip/ac37b3718a8c7513fa63588e5928858f to your computer and use it in GitHub Desktop.
Unhooks the WooCommerce Order emails sent to Vendors if the order is on hold
/* Remove WooCommerce On Hold emails sent to Vendors */
add_action( 'woocommerce_email', 'unhook_vendor_new_order_email_if_order_is_on_hold' );
function unhook_vendor_new_order_email_if_order_is_on_hold( $email_class ) {
remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Product_Vendors_Order_Email_To_Vendor'], 'trigger' ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment