diff options
Diffstat (limited to 'wp-includes/class-wp-user.php')
-rw-r--r-- | wp-includes/class-wp-user.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/wp-includes/class-wp-user.php b/wp-includes/class-wp-user.php index aa75980..0be1b3e 100644 --- a/wp-includes/class-wp-user.php +++ b/wp-includes/class-wp-user.php @@ -117,13 +117,18 @@ class WP_User { * * @since 2.0.0 * + * @global wpdb $wpdb WordPress database abstraction object. + * * @param int|string|stdClass|WP_User $id User's ID, a WP_User object, or a user object from the DB. * @param string $name Optional. User's username * @param int $site_id Optional Site ID, defaults to current site. */ public function __construct( $id = 0, $name = '', $site_id = '' ) { + global $wpdb; + if ( ! isset( self::$back_compat_keys ) ) { - $prefix = $GLOBALS['wpdb']->prefix; + $prefix = $wpdb->prefix; + self::$back_compat_keys = array( 'user_firstname' => 'first_name', 'user_lastname' => 'last_name', @@ -186,7 +191,7 @@ class WP_User { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $field The field to query against: 'id', 'ID', 'slug', 'email' or 'login'. + * @param string $field The field to query against: Accepts 'id', 'ID', 'slug', 'email' or 'login'. * @param string|int $value The field value. * @return object|false Raw user object. */ |