Hide errors when getting usermeta in case we're upgrading and usermeta doesn't exist yet. fixes #2110
git-svn-id: https://develop.svn.wordpress.org/trunk@3343 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5acb6224ec
commit
714948d9ed
@ -42,7 +42,9 @@ function get_userdata( $user_id ) {
|
||||
if ( !$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID = '$user_id' LIMIT 1") )
|
||||
return false;
|
||||
|
||||
$wpdb->hide_errors();
|
||||
$metavalues = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user_id'");
|
||||
$wpdb->show_errors();
|
||||
|
||||
if ($metavalues) {
|
||||
foreach ( $metavalues as $meta ) {
|
||||
@ -85,7 +87,9 @@ function get_userdatabylogin($user_login) {
|
||||
if ( !$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_login = '$user_login'") )
|
||||
return false;
|
||||
|
||||
$wpdb->hide_errors();
|
||||
$metavalues = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user->ID'");
|
||||
$wpdb->show_errors();
|
||||
|
||||
if ($metavalues) {
|
||||
foreach ( $metavalues as $meta ) {
|
||||
|
Loading…
Reference in New Issue
Block a user