mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
11 lines
327 B
Text
11 lines
327 B
Text
add_filter('woocommerce_email_recipient_new_order', 'restrict_admin_new_order_mail', 1, 2);
|
|
function restrict_admin_new_order_mail( $recipient, $order ) {
|
|
if ( ! is_a( $order, 'WC_Order' ) )
|
|
return $recipient;
|
|
|
|
if( $order->get_total() > 0 ) {
|
|
return $recipient;
|
|
} else {
|
|
return '';
|
|
}
|
|
}
|