Don't consult global current_user object for usermeta values. Use get_userdata().
git-svn-id: http://svn.automattic.com/wordpress/trunk@14311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7ef5f08d00
commit
79ccf9e0c7
|
@ -238,10 +238,11 @@ function get_user_option( $option, $user = 0, $deprecated = '' ) {
|
||||||
|
|
||||||
if ( empty($user) ) {
|
if ( empty($user) ) {
|
||||||
$user = wp_get_current_user();
|
$user = wp_get_current_user();
|
||||||
} else {
|
$user = $user->ID;
|
||||||
$user = get_userdata($user);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$user = get_userdata($user);
|
||||||
|
|
||||||
// Keys used as object vars cannot have dashes.
|
// Keys used as object vars cannot have dashes.
|
||||||
$key = str_replace('-', '_', $option);
|
$key = str_replace('-', '_', $option);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue