Plugin Directory

Changeset 2788950


Ignore:
Timestamp:
09/22/2022 07:43:03 PM (4 years ago)
Author:
lddwebdesign
Message:

3.5 update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ldd-directory-lite/trunk/includes/template-functions.php

    r2747287 r2788950  
    11231123}
    11241124add_action('init','ldd_directory_layout');
     1125
     1126function 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.