diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
commit | 30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch) | |
tree | 39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-includes/class-wp-user.php | |
parent | Adding upstream version 6.4.3+dfsg1. (diff) | |
download | wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip |
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-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. */ |