mirror of
git://develop.git.wordpress.org/
synced 2025-01-18 05:18:42 +01:00
Wrap metavalue loop in is_array to check to avoid invalid argument warning.
git-svn-id: https://develop.svn.wordpress.org/trunk@2640 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
afc06a6f56
commit
1b4bc53f13
@ -1168,9 +1168,10 @@ function update_user_cache() {
|
||||
if ( $users = $wpdb->get_results( $query ) ) :
|
||||
foreach ($users as $user) :
|
||||
$metavalues = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user->ID'");
|
||||
|
||||
foreach ( $metavalues as $meta )
|
||||
$user->{$meta->meta_key} = $meta->meta_value;
|
||||
if ( is_array($metavalues) )
|
||||
foreach ( $metavalues as $meta )
|
||||
$user->{$meta->meta_key} = $meta->meta_value;
|
||||
|
||||
$cache_userdata[$user->ID] = $user;
|
||||
$cache_userdata[$user->user_login] =& $cache_userdata[$user->ID];
|
||||
endforeach;
|
||||
|
Loading…
x
Reference in New Issue
Block a user