Changeset 2788950
- Timestamp:
- 09/22/2022 07:43:03 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ldd-directory-lite/trunk/includes/template-functions.php
r2747287 r2788950 1123 1123 } 1124 1124 add_action('init','ldd_directory_layout'); 1125 1126 function ldd_captcha_jq() { 1127 1128 if(ldl()->get_option('google_recaptcha_site')){ 1129 ?> 1130 <script> 1131 jQuery( "#contact-form-submit" ).click(function(event){ 1132 1133 var $captcha = jQuery( "#recaptcha" ), 1134 response = grecaptcha.getResponse(); 1135 1136 if (response.length === 0) { 1137 event.preventDefault(); 1138 jQuery( ".msg-error").text( "reCAPTCHA is mandatory" ); 1139 if( !$captcha.hasClass( "unhappyMessage" ) ){ 1140 $captcha.addClass( "unhappyMessage" ); 1141 } 1142 } else { 1143 jQuery( ".msg-error" ).text(""); 1144 $captcha.removeClass( "unhappyMessage" ); 1145 1146 } 1147 }) 1148 1149 </script> 1150 <?php 1151 } 1152 } 1153 1154 add_action('wp_footer', 'ldd_captcha_jq'); 1155 ?>
Note: See TracChangeset
for help on using the changeset viewer.