mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-30 11:42:22 +08:00
https://wordpress.org/support/topic/disable-on-hold-status-for-cheque-payments-used-processing-instead/
7 lines
452 B
Text
7 lines
452 B
Text
// Send 'On Hold' email notification when order is manually set to 'On Hold'
|
|
add_action( 'woocommerce_order_status_changed', 'send_on_hold_email_on_manual_status_change', 10, 4 );
|
|
function send_on_hold_email_on_manual_status_change( $order_id, $old_status, $new_status, $order ) {
|
|
if ( 'on-hold' === $new_status && 'on-hold' !== $old_status ) {
|
|
WC()->mailer()->get_emails()['WC_Email_Customer_On_Hold_Order']->trigger( $order_id );
|
|
}
|
|
}
|