_bb_get_plugin_data_translate

The BuddyPress bb get plugin data translate function.

Description

_bb_get_plugin_data_translate( $plugin_data, $plugin_file ); 

Parameters (2)

0. $plugin_data
The plugin data.
1. $plugin_file
The plugin file.

Usage

  1. if ( !function_exists( '_bb_get_plugin_data_translate' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-plugin.php'; 
  3.  
  4. // The plugin data. 
  5. $plugin_data = null; 
  6.  
  7. // The plugin file. 
  8. $plugin_file = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = _bb_get_plugin_data_translate($plugin_data, $plugin_file); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-admin/includes/functions.bb-plugin.php  
  1. function _bb_get_plugin_data_translate( $plugin_data, $plugin_file ) { 
  2. //Translate fields 
  3. if( !empty($plugin_data['text_domain']) ) { 
  4. if( ! empty( $plugin_data['domain_path'] ) ) 
  5. bb_load_plugin_textdomain($plugin_data['text_domain'], dirname($plugin_file). $plugin_data['domain_path']); 
  6. else 
  7. bb_load_plugin_textdomain($plugin_data['text_domain'], dirname($plugin_file)); 
  8.  
  9. foreach ( array('name', 'plugin_url', 'description', 'author', 'author_uri', 'version') as $field ) 
  10. $plugin_data[$field] = translate($plugin_data[$field], $plugin_data['text_domain']); 
  11.  
  12. return $plugin_data;