How to Change Google reCAPTCHA Language Settings

/** * Set a specific language Google reCAPTCHA. * * @link https://wpforms.com/developers/how-to-set-the-language-for-google-recaptcha/ */ function wpf_dev_recaptcha_language_wpml( $url ) { // Get my current language setting from WPML $my_current_lang = apply_filters( ‘wpml_current_language’, NULL ); // Set the language of my Google reCAPTCHA…Continue reading

How to Set the Language for Google reCAPTCHA

/** * Set the language for Google reCAPTCHA. * * @link https://wpforms.com/developers/how-to-set-the-language-for-google-recaptcha/ */ 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’,…Continue reading

How to Get the URL from the File Upload Form Field

/** * Get and use the File Upload field URL * * @link https://wpforms.com/developers/how-to-get-the-url-from-the-file-upload-form-field/ */ function wpf_dev_frontend_confirmation_message( $message, $form_data, $fields, $entry_id ) { // Only run on my form with ID = 1000 if ( absint( $form_data[ ‘id’ ] )…Continue reading

How to Defer the reCAPTCHA Script

/** * Defer the reCAPTCHA script until after the page loads * * @link https://wpforms.com/developers/how-to-defer-the-recaptcha-script/ */ function wpf_recaptcha_add_async_defer( $tag, $handle ) { if ( strpos( $tag, ‘recaptcha/api.js?onload=wpformsRecaptchaLoad’ ) !== false ) { $tag = str_replace( ‘ src’, ‘ defer async=”async”…Continue reading