_bb_translate_for_export

The BuddyPress bb translate for export function.

Description

_bb_translate_for_export( $translate, &$data ); 

Parameters (2)

0. $translate
The translate.
1. $data
The data.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-admin/export.php  
  1. function _bb_translate_for_export( $translate, &$data ) { 
  2. $r = array(); 
  3. foreach ( $translate as $prop => $export ) { 
  4. if ( '?' == $export{0} ) { 
  5. $export = substr($export, 1); 
  6. if ( !$data[$prop] ) { 
  7. unset($data[$prop]); 
  8. continue; 
  9. if ( false === $export ) { 
  10. unset($data[$prop]); 
  11. continue; 
  12. $r[$export] = $data[$prop]; 
  13. unset($data[$prop]); 
  14. unset($export, $prop); 
  15. return $r;