get_base_recaptcha_lang_code

The Jetpack by WordPress.com get base recaptcha lang code function.

Description

get_base_recaptcha_lang_code(); 

Usage

  1. if ( !function_exists( 'get_base_recaptcha_lang_code' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/sharedaddy/sharing-service.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_base_recaptcha_lang_code(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/modules/sharedaddy/sharing-service.php  
  1. function get_base_recaptcha_lang_code() { 
  2.  
  3. $base_recaptcha_lang_code_mapping = array( 
  4. 'en' => 'en',  
  5. 'nl' => 'nl',  
  6. 'fr' => 'fr',  
  7. 'fr-be' => 'fr',  
  8. 'fr-ca' => 'fr',  
  9. 'fr-ch' => 'fr',  
  10. 'de' => 'de',  
  11. 'pt' => 'pt',  
  12. 'pt-br' => 'pt',  
  13. 'ru' => 'ru',  
  14. 'es' => 'es',  
  15. 'tr' => 'tr' 
  16. ); 
  17.  
  18. $blog_lang_code = function_exists( 'get_blog_lang_code' ) ? get_blog_lang_code() : get_bloginfo( 'language' ); 
  19. if( isset( $base_recaptcha_lang_code_mapping[ $blog_lang_code ] ) ) 
  20. return $base_recaptcha_lang_code_mapping[ $blog_lang_code ]; 
  21.  
  22. // if no base mapping is found return default 'en' 
  23. return 'en';