mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 18:54:29 +00:00
current user cleanup
git-svn-id: https://develop.svn.wordpress.org/trunk@3566 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -303,10 +303,10 @@ function get_option($option) {
|
||||
}
|
||||
|
||||
function get_user_option( $option, $user = 0 ) {
|
||||
global $wpdb, $current_user;
|
||||
global $wpdb;
|
||||
|
||||
if ( empty($user) )
|
||||
$user = $current_user;
|
||||
$user = wp_get_current_user();
|
||||
else
|
||||
$user = get_userdata($user);
|
||||
|
||||
@@ -1176,6 +1176,28 @@ function setup_postdata($post) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Setup global user vars. Used by set_current_user() for back compat.
|
||||
function setup_userdata($user_id = '') {
|
||||
global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity;
|
||||
|
||||
if ( '' == $user_id )
|
||||
$user = wp_get_current_user();
|
||||
else
|
||||
$user = new WP_User($user_id);
|
||||
|
||||
if ( 0 == $user->ID )
|
||||
return;
|
||||
|
||||
$userdata = $user->data;
|
||||
$user_login = $user->user_login;
|
||||
$user_level = $user->user_level;
|
||||
$user_ID = $user->ID;
|
||||
$user_email = $user->user_email;
|
||||
$user_url = $user->user_url;
|
||||
$user_pass_md5 = md5($user->user_pass);
|
||||
$user_identity = $user->display_name;
|
||||
}
|
||||
|
||||
function is_new_day() {
|
||||
global $day, $previousday;
|
||||
if ( $day != $previousday ) {
|
||||
|
||||
Reference in New Issue
Block a user