Support » Plugin: Contact Form 7 Confirm Email Field » GREAT, but Some additional code… needed to get from 4* to 5*

  • darlio


    I really like this very efficient and easy plugin.

    Some code should be added to get the full features :
    – A RED text saying that the email is wrongly written.
    – Style completely similar to the email field of CF7.

    Hope this helps ! And thank you to Author to adapt his code more or less as described, or better…

    (Code bellow is partially given by KliffBlack)
    ———- Here is the code and where to put it ———-
    <<<< Getting the message about wrong match >>>>

    1. Open the php file
    –> Named : contact-form-7-confirm-email.php
    –> In folder : […]wp-content/plugins/contact-form-7-confirm-email-feild (yes, f e i l d, this is a typo from the author of the plug in)

    2. Add the filter:
    –> What : add_filter( ‘wpcf7_messages’, ‘confirm_email_messages’);
    –> Where : at line 24 (for example, must be with the others)

    3. Add the function it refers to :
    –> What :
    //add error message
    function confirm_email_messages($messages) {
    $messages[‘invalid_confirm_email’] = array(
    ‘description’ => __(‘The email addresses do not match.’),
    ‘default’ => __(‘The email addresses do not match.’),

    return $messages;
    –> Where : at line 109 (for example, must be outside an existing function.

    <<<< Making the confirm_email input field look like the email one >>>>
    What : $class .= ‘ ‘.wpcf7_form_controls_class( $tag->type, ‘wpcf7-text’ );
    Where : at line 50

    • This topic was modified 4 years ago by darlio.
  • The topic ‘GREAT, but Some additional code… needed to get from 4* to 5*’ is closed to new replies.