mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
8 lines
410 B
Text
8 lines
410 B
Text
add_action( 'woocommerce_after_checkout_validation', 'wc_blacklist_billing_email', 9999, 2 );
|
|
|
|
function wc_blacklist_billing_email( $data, $errors ) {
|
|
$blacklist = [ 'hello@example.com', 'info@lorem.io', 'me@john.co' ];
|
|
if ( in_array( $data['billing_email'], $blacklist ) ) {
|
|
$errors->add( 'blacklist', __( 'Sorry, our website is currently unable to process your request.', 'bbloomer' ) );
|
|
}
|
|
}
|