Skip to content

Instantly share code, notes, and snippets.

@alex-authlab
Forked from reachkamrul/FFCustomReCaptcha.php
Created April 1, 2021 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex-authlab/ca90794f906d9e74fe542c4c31c40232 to your computer and use it in GitHub Desktop.
Save alex-authlab/ca90794f906d9e74fe542c4c31c40232 to your computer and use it in GitHub Desktop.
add_action('recaptcha_custom_function', 'recaptcha_custom_function_callback', 10, 1 );
function recaptcha_custom_function_callback( $form) {
echo '
<script type="text/javascript">
jQuery( document ).ready(function() {
jQuery(".ff-btn-submit").attr("disabled", "true");
});
function enableBtn(){
jQuery(".ff-btn-submit").removeAttr("disabled");
}
</script>';
echo "<script src='https://www.google.com/recaptcha/api.js' async defer ></script>";
?>
<div class="ff-el-group" data-name="recaptcha">
<div class="ff-el-input--content">
<div class="ff-el-recaptcha g-recaptcha" data-sitekey="6LcpRNoZAAAAAB5CPHvzM-n-RfVvyFojnbxjTNOB" data-callback="enableBtn"></div>
</div>
</div>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment