Description
The wpforms_frontend_recaptcha_url
filter used to alter the default URL for the reCAPTCHA language. By default, Google’s reCAPTCHA will detect the language and supply the correct translations for your site. This filter should only be used if you want to force the language for all visitors.
Parameters
- $url
- (string) URL used for the default language used in Google’s reCAPTCHA.
Source
wpforms/src/Frontend/Captcha.php
More Information
The filter can be used to alter the default URL for the language on Google’s reCAPTCHA.
Example
/** * Alter default reCAPTCHA language URL. * * @link https://wpforms.com/developers/wpforms_frontend_recaptcha_url/ * * @param string $url URL of language to be used for Google's reCAPTCHA. * @return string */ function wpf_dev_recaptcha_language( $url ) { // Set the language code to FR (French) return esc_url_raw( add_query_arg( array( 'hl' => 'fr '), $url ) ); } add_filter( 'wpforms_frontend_recaptcha_url', 'wpf_dev_recaptcha_language', 10, 1);
To find your specific language code, please see Google’s documentation on reCAPTCHA Language Codes.