bb_get_all_user_settings

Retrieve all user interface settings.

Description

(array) bb_get_all_user_settings(); 

Returns (array)

the last saved user settings or empty array.


Usage

  1. if ( !function_exists( 'bb_get_all_user_settings' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bb_get_all_user_settings(); 
  7.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-meta.php  
  1. function bb_get_all_user_settings() 
  2. if ( ! $user = bb_get_current_user() ) { 
  3. return array(); 
  4.  
  5. $arr = array(); 
  6. if ( isset( $_COOKIE['bb-user-settings-' . $user->ID] ) ) { 
  7. $cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE['bb-user-settings-' . $user->ID] ); 
  8.  
  9. if ( $cookie && strpos( $cookie, '=' ) ) { // the '=' cannot be 1st char 
  10. parse_str( $cookie, $arr ); 
  11. } elseif ( isset( $user->bb_user_settings ) && is_string( $user->bb_user_settings ) ) { 
  12. parse_str( $user->bb_user_settings, $arr ); 
  13.  
  14. return $arr;