1. Docs
  2. Developer Guide
  3. Miscellaneous and Snippets
  4. Add Google reCAPTCHA To Property Enquiry Form

Add Google reCAPTCHA To Property Enquiry Form

Once you’ve obtained your API keys here you can simply add the following to your theme’s functions.php file:

add_filter( 'propertyhive_property_enquiry_form_fields', 'add_recaptcha_to_enquiry_form', 10, 1 );
function add_recaptcha_to_enquiry_form( $fields )
{
    $fields['recaptcha'] = array(
        'type' => 'recaptcha',
        'site_key' => 'your-key-here',
        'secret' => 'your-secret-here',
    );
    return $fields;
}

Please note this functionality is only available in Property Hive version 1.4.22 or later.

Was this article helpful to you? Yes No