Viewing 1 replies (of 1 total)
  • Thread Starter Vignesh

    (@vignesh568)

    I found the way

    just add the following codes in wp-user-frontend/wpuf-add-post.php

    1.below this code “””””do_action( ‘wpuf_add_post_form_tags’, $post_type );
    wpuf_build_custom_field_form( ‘bottom’ );
    ?>”””””

    add this

    <?php
    require_once(‘recaptchalib.php’);
    $publickey = “your captcha code publickey”; // you got this from the signup page
    echo recaptcha_get_html($publickey);
    ?>

    2.below this code “”””//validate title
    if ( empty( $title ) ) {
    $errors[] = __( ‘Empty post title’, ‘wpuf’ );
    } else {
    $title = trim( strip_tags( $title ) );
    }”””””

    add this

    require_once(‘recaptchalib.php’);
    $privatekey = “your captcha code private key”;
    $resp = recaptcha_check_answer ($privatekey,
    $_SERVER[“REMOTE_ADDR”],
    $_POST[“recaptcha_challenge_field”],
    $_POST[“recaptcha_response_field”]);

    if (!$resp->is_valid) {
    // What happens when the CAPTCHA was entered incorrectly
    die (“The reCAPTCHA wasn’t entered correctly. Go back and try it again.” .
    “(reCAPTCHA said: ” . $resp->error . “)”);
    } else {
    // Your code here to handle a successful verification
    }

    to get your captcha code vist this https://www.google.com/recaptcha/admin#whyrecaptcha

    To get Captcha do the following things and also install wp-recaptcha plugin

Viewing 1 replies (of 1 total)
  • The topic ‘How to add google captcha in wp user frontend non pro version’ is closed to new replies.