Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_all_user_settings [ WordPress Function ]

get_all_user_settings ( No parameters )
Returns:
  • (array) the last saved user settings or empty array.
Defined at:



Retrieve all user interface settings.

Source


<?php
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;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics