mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-03 12:12:25 +08:00
https://github.com/impress-org/givewp-snippet-library/blob/master/admin-functions/add-email-to-block-list.php
14 lines
375 B
Text
14 lines
375 B
Text
function my_give_block_list( $spam ){
|
|
|
|
$email = give_clean($_POST['give_email']);
|
|
|
|
//replace the emails in the array with emails you want to block
|
|
$blocked = array('nefarious@example.com','badguy@example.com' );
|
|
|
|
if( in_array( $email, $blocked ) ) {
|
|
$spam = true;
|
|
}
|
|
return $spam;
|
|
}
|
|
|
|
add_filter( 'give_spam', 'my_give_block_list', 0, 1 );
|