Last active
          July 21, 2020 07:30 
        
      - 
      
 - 
        
Save shivapoudel/75e6d6167af25ee61d46fc27534609ab to your computer and use it in GitHub Desktop.  
Revisions
- 
        
shivapoudel revised this gist
Jul 21, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,8 @@ /** * Language code support for reCAPTCHA v2. * * @param string $recaptcha_url reCAPTCHA Url. * @param string $recaptcha_type reCAPTCHA type. * * @return string Modified url with language code. */  - 
        
shivapoudel revised this gist
Jul 21, 2020 . 1 changed file with 10 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ /** * Code goes in theme functions.php. */ add_filter( 'everest_forms_frontend_recaptcha_url', 'evf_recaptcha_lang_code', 10, 2 ); /** * Language code support for reCAPTCHA v2. @@ -12,22 +12,15 @@ * * @return string Modified url with language code. */ function evf_recaptcha_lang_code( $recaptcha_url, $recaptcha_type ) { if ( 'v2' === $recaptcha_type ) { /** * Forces the widget to render in a specific language. * Additionally, uuto-detects the user's language if unspecified. * * @see https://developers.google.com/recaptcha/docs/display#config */ $recaptcha_url = add_query_arg( 'hl', 'id', $recaptcha_url ); } return $recaptcha_url;  - 
        
shivapoudel revised this gist
Jul 11, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,4 +31,4 @@ function evf_recaptcha_lang_code( $recaptcha_url ) { } return $recaptcha_url; }  - 
        
shivapoudel created this gist
Jul 11, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ <?php // Do not include this if already open! /** * Code goes in theme functions.php. */ add_filter( 'everest_forms_frontend_recaptcha_url', 'evf_recaptcha_lang_code' ); /** * Language code support for reCAPTCHA v2. * * @param string $recaptcha_url reCAPTCHA Url. * * @return string Modified url with language code. */ function evf_recaptcha_lang_code( $recaptcha_url ) { $query_args = array(); $query_string = wp_parse_url( $recaptcha_url, PHP_URL_QUERY ); if ( is_string( $query_string ) ) { parse_str( $query_string, $query_args ); if ( isset( $query_args['onload'] ) && 'EVFRecaptchaLoad' === $query_args['onload'] ) { /** * Forces the widget to render in a specific language. * Additionally, uuto-detects the user's language if unspecified. * * @see https://developers.google.com/recaptcha/docs/display#config */ $recaptcha_url = add_query_arg( 'hl', 'id', $recaptcha_url ); } } return $recaptcha_url; }