Description

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/includes/class-frontend.php

More Information

The wpforms_frontend_recaptcha_url 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 ) {
 
    return esc_url_raw( add_query_arg( array( 'hl' => 'fr '), $url ) );
}
add_filter( 'wpforms_frontend_recaptcha_url', 'wpf_dev_recaptcha_language' );

Snippet Reference: How to Set the Language for Google reCAPTCHA