• Resolved ksvgn2018

    (@ksvgn2018)


    Hi, I’m using this code to block specific e-mail adresses from using the forms:

    /*
     * Blacklist emails from your WPForms.
     *
     * @link https://wpforms.com/developers/how-to-block-email-addresses-from-your-forms/
     *
    */
     
    function wpf_dev_blacklist( $honeypot, $fields, $entry, $form_data ) {
     
        // Use the email as the key. The value will be used in the log
        $blacklist = array(
            '123test@me.com' => 'Ima Believer',
            'me@me.com' => 'Me Me'
        );
         
        foreach( $form_data['fields'] as $id => $field ) {
            if( 'email' == $field['type'] && array_key_exists( $entry['fields'][$id], $blacklist ) )
                $honeypot = '[Blacklist] ' . $blacklist[$entry['fields'][$id]];
        }
         
        return $honeypot;
    }
    add_filter( 'wpforms_process_honeypot', 'wpf_dev_blacklist', 10, 4 );

    So far, so good but what happens is that the user who sends a blocked e-mail address gets redirected to home. How can I achieve sending him to an error page that I created?

    • This topic was modified 5 years, 7 months ago by ksvgn2018.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Forwarding to error page for blocked e-mails’ is closed to new replies.