Definition:
function get_all_user_settings() {}
Retrieve all user interface settings.
Return values
returns:the last saved user settings or empty array.
Source code
function get_all_user_settings() {
global $_updated_user_settings;
if ( ! $user = wp_get_current_user() )
return array();
if ( isset($_updated_user_settings) && is_array($_updated_user_settings) )
return $_updated_user_settings;
$all = array();
if ( isset($_COOKIE['wp-settings-' . $user->ID]) ) {
$cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE['wp-settings-' . $user->ID] );
if ( $cookie && strpos($cookie, '=') ) // the '=' cannot be 1st char
parse_str($cookie, $all);
} else {
$option = get_user_option('user-settings', $user->ID);
if ( $option && is_string($option) )
parse_str( $option, $all );
}
return $all;
}
1140

February 11, 2011 


No comments yet... Be the first to leave a reply!