ddw_gftb_l10n_global_string_output

Get a certain translated string from the 'gravityforms' textdomain.

Description

(string) ddw_gftb_l10n_global_string_output( (string) $string = '' ); 

Returns (string)

Translated string from the original English string.

Parameters (1)

0. $string — Optional. (string) => ''
Original English string.

Usage

  1. if ( !function_exists( 'ddw_gftb_l10n_global_string_output' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'gravity-forms-toolbar/lib/gftb-functions.php'; 
  3.  
  4. // Original English string. 
  5. $string = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ddw_gftb_l10n_global_string_output($string); 
  9.  

Defined (1)

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

/lib/gftb-functions.php  
  1. function ddw_gftb_l10n_global_string_output( $string = '' ) { 
  2.  
  3. global $l10n; 
  4.  
  5. $gftb_output = ''; 
  6.  
  7. /** Get the translated string from the global variable */ 
  8. if ( isset( $l10n[ 'gravityforms' ] ) 
  9. && isset( $l10n[ 'gravityforms' ]->entries[ $string ] ) 
  10. ) { 
  11.  
  12. $gftb_output = $l10n[ 'gravityforms' ]->entries[ $string ]->translations[0]; 
  13.  
  14. } // end if 
  15.  
  16. /** Return the found string for further operations... */ 
  17. return $gftb_output; 
  18.  
  19. } // end of function ddw_gftb_l10n_global_string_output