Allows admins to block all donations from a specific email address in GiveWP

Allows admins to block all donations from a specific email address in GiveWP on child sites.

Snippet Type

Execute on Child Sites

Snippet

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('[email protected]','[email protected]' );

    if( in_array( $email, $blocked ) ) {
        $spam = true;
    } 
    return $spam;
}

add_filter( 'give_spam', 'my_give_block_list', 0, 1 );