backpress_convert_object

The BuddyPress backpress convert object function.

Description

backpress_convert_object( &$object, $output ); 

Parameters (2)

0. $object
The object.
1. $output
The output.

Usage

  1. if ( !function_exists( 'backpress_convert_object' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/backpress/functions.core.php'; 
  3.  
  4. // The object. 
  5. $object = &$object; 
  6.  
  7. // The output. 
  8. $output = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = backpress_convert_object($object, $output); 
  12.  

Defined (2)

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

/bp-forums/bbpress/bb-includes/backpress/functions.core.php  
  1. function backpress_convert_object( &$object, $output ) { 
  2. if ( is_array( $object ) ) { 
  3. foreach ( array_keys( $object ) as $key ) 
  4. backpress_convert_object( $object[$key], $output ); 
  5. } else { 
  6. switch ( $output ) { 
  7. case OBJECT : break; 
  8. case ARRAY_A : $object = get_object_vars($object); break; 
  9. case ARRAY_N : $object = array_values(get_object_vars($object)); break; 
/bp-forums/bp-forums-bbpress-sa.php  
  1. function backpress_convert_object( &$object, $output ) { 
  2. if ( is_array( $object ) ) { 
  3. foreach ( array_keys( $object ) as $key ) 
  4. backpress_convert_object( $object[$key], $output ); 
  5. } else { 
  6. switch ( $output ) { 
  7. case OBJECT : break; 
  8. case ARRAY_A : $object = get_object_vars($object); break; 
  9. case ARRAY_N : $object = array_values(get_object_vars($object)); break;