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

git-svn-id: https://develop.svn.wordpress.org/trunk@11118 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-04-29 05:43:03 +00:00
parent 61f7821b34
commit 4a911beaf3
8 changed files with 53 additions and 27 deletions
+9 -7
View File
@@ -826,7 +826,7 @@ function delete_user_setting( $names ) {
$settings = rtrim($settings, '&');
update_user_option( $current_user->ID, 'user-settings', $settings );
setcookie('wp-settings-'.$current_user->ID, $settings, time() + 31536000, SITECOOKIEPATH);
setcookie('wp-settings-' . $current_user->ID, $settings, time() + 31536000, SITECOOKIEPATH);
}
}
@@ -843,16 +843,18 @@ function get_all_user_settings() {
if ( ! $user = wp_get_current_user() )
return array();
if ( isset($_COOKIE['wp-settings-'.$user->ID]) ) {
$cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE['wp-settings-'.$user->ID] );
$arr = 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
if ( $cookie && strpos($cookie, '=') ) // the '=' cannot be 1st char
parse_str($cookie, $arr);
return $arr;
}
} elseif ( isset($user->wp_usersettings) && is_string($user->wp_usersettings) ) {
parse_str( $user->wp_usersettings, $arr );
}
return array();
return $arr;
}
/**