wpcf7_l10n

The Contact Form 7 wpcf7 l10n function.

Description

wpcf7_l10n(); 

Usage

  1. if ( !function_exists( 'wpcf7_l10n' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/includes/l10n.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wpcf7_l10n(); 
  7.  

Defined (1)

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

/includes/l10n.php  
  1. function wpcf7_l10n() { 
  2. static $l10n = array(); 
  3.  
  4. if ( ! empty( $l10n ) ) { 
  5. return $l10n; 
  6.  
  7. if ( ! is_admin() ) { 
  8. return $l10n; 
  9.  
  10. require_once( ABSPATH . 'wp-admin/includes/translation-install.php' ); 
  11.  
  12. $api = translations_api( 'plugins', array( 
  13. 'slug' => 'contact-form-7',  
  14. 'version' => WPCF7_VERSION,  
  15. ) ); 
  16.  
  17. if ( is_wp_error( $api ) || empty( $api[translations] ) ) { 
  18. return $l10n; 
  19.  
  20. foreach ( (array) $api[translations] as $translation ) { 
  21. if ( ! empty( $translation['language'] ) 
  22. && ! empty( $translation['english_name'] ) ) { 
  23. $l10n[$translation['language']] = $translation['english_name']; 
  24.  
  25. return $l10n;