Created
December 17, 2020 11:02
-
-
Save nikitasinelnikov/65b6252b0ae961e4a0dcee680b5b573e to your computer and use it in GitHub Desktop.
Ultimate Member - Google reCAPTCHA: Change language code based on WPML locale
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 characters
function um_custom_recaptcha_language_code( $lang ) { | |
if ( UM()->external_integrations()->is_wpml_active() ) { | |
global $sitepress; | |
$language_code = $sitepress->get_current_language(); | |
if ( $language_code == 'zh-hant' ) { | |
$lang = 'zh-TW'; | |
} | |
} | |
return $lang; | |
} | |
add_action( 'um_recaptcha_language_code', 'um_custom_recaptcha_language_code', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment