diff --git a/wp-includes/class-wp-user.php b/wp-includes/class-wp-user.php index aa759804c8..a3e40df164 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', diff --git a/wp-includes/version.php b/wp-includes/version.php index 2a49c80154..649c9e16e8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57189'; +$wp_version = '6.5-alpha-57190'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.