wpcf7_is_rtl

The Contact Form 7 wpcf7 is rtl function.

Description

wpcf7_is_rtl( (string) $locale = '' ); 

Parameters (1)

0. $locale — Optional. (string) => ''
The locale.

Usage

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

Defined (1)

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

/includes/l10n.php  
  1. function wpcf7_is_rtl( $locale = '' ) { 
  2. static $rtl_locales = array( 
  3. 'ar' => 'Arabic',  
  4. 'ary' => 'Moroccan Arabic',  
  5. 'azb' => 'South Azerbaijani',  
  6. 'fa_IR' => 'Persian',  
  7. 'haz' => 'Hazaragi',  
  8. 'he_IL' => 'Hebrew',  
  9. 'ps' => 'Pashto',  
  10. 'ug_CN' => 'Uighur',  
  11. ); 
  12.  
  13. if ( empty( $locale ) && function_exists( 'is_rtl' ) ) { 
  14. return is_rtl(); 
  15.  
  16. if ( empty( $locale ) ) { 
  17. $locale = get_locale(); 
  18.  
  19. return isset( $rtl_locales[$locale] );