Wrap metavalue loop in is_array to check to avoid invalid argument warning.
git-svn-id: http://svn.automattic.com/wordpress/trunk@2640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4a25d166b4
commit
fa147528c6
|
@ -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'");
|
||||
|
||||
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…
Reference in New Issue