• Hi

    Awesome plugin. Really slick and clean design. Thank you!

    Unfortunately when someone is trying to ask a question using the question form, email and name field is not validated. Anyone can post a comment without enforcing those fields.

    Could you add that feature or let me know where can i amend the setting in the code?

    Thanks

    https://wordpress.org/plugins/dw-question-answer/

Viewing 1 replies (of 1 total)
  • Plugin Author DesignWall

    (@designwall)

    Hi,
    To resolve this issue, you can open the wp-content/plugins/dwqa-question-answer/inc/Handle.php file.
    and add the following code under line 64:


    if ( !is_user_logged_in() && empty( $_POST['user-email'] ) && !is_email( $_POST['user-email'] ) ) {
    dwqa_add_notice( __( 'You must enter a valid email.' ), 'error' );
    return false;
    }

    if ( !is_user_logged_in() && empty( $_POST['user-name'] ) && !is_email( $_POST['user-name'] ) ) {
    dwqa_add_notice( __( 'You must enter your name.' ), 'error' );
    return false;
    }

    And add the following code under line 21 (after adding the previous code):


    if ( !is_user_logged_in() && empty( $_POST['email'] ) && !is_email( $_POST['email'] ) ) {
    dwqa_add_notice( __( 'You must enter a valid email.' ), 'error' );
    return false;
    }

    if ( !is_user_logged_in() && empty( $_POST['name'] ) && !is_email( $_POST['name'] ) ) {
    dwqa_add_notice( __( 'You must enter your name.' ), 'error' );
    return false;
    }

    Hope this helps!
    Dominic from DesignWall team.

Viewing 1 replies (of 1 total)

The topic ‘emails and names are not validated’ is closed to new replies.