Make WordPress Core


Ignore:
Timestamp:
04/29/2009 05:43:03 AM (16 years ago)
Author:
azaozz
Message:

Load the menu folded (if set), load the editor earlier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r11109 r11118  
    827827
    828828        update_user_option( $current_user->ID, 'user-settings', $settings );
    829         setcookie('wp-settings-'.$current_user->ID, $settings, time() + 31536000, SITECOOKIEPATH);
     829        setcookie('wp-settings-' . $current_user->ID, $settings, time() + 31536000, SITECOOKIEPATH);
    830830    }
    831831}
     
    844844        return array();
    845845
    846     if ( isset($_COOKIE['wp-settings-'.$user->ID]) ) {
    847         $cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE['wp-settings-'.$user->ID] );
    848 
    849         if ( $cookie && strpos($cookie, '=') ) { // the '=' cannot be 1st char
     846    $arr = array();
     847    if ( isset($_COOKIE['wp-settings-' . $user->ID]) ) {
     848        $cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE['wp-settings-' . $user->ID] );
     849
     850        if ( $cookie && strpos($cookie, '=') ) // the '=' cannot be 1st char
    850851            parse_str($cookie, $arr);
    851             return $arr;
    852         }
    853     }
    854 
    855     return array();
     852
     853    } elseif ( isset($user->wp_usersettings) && is_string($user->wp_usersettings) ) {
     854        parse_str( $user->wp_usersettings, $arr );
     855    }
     856
     857    return $arr;
    856858}
    857859
Note: See TracChangeset for help on using the changeset viewer.