Docs: Document the `$wpdb` global in `WP_User::__construct()`.

Follow-up to [19325].

Props upadalavipul.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57190


git-svn-id: http://core.svn.wordpress.org/trunk@56701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-12-15 12:37:29 +00:00
parent 8361461aa0
commit c07e1c4442
2 changed files with 7 additions and 2 deletions

View File

@ -117,13 +117,18 @@ class WP_User {
* *
* @since 2.0.0 * @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 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 string $name Optional. User's username
* @param int $site_id Optional Site ID, defaults to current site. * @param int $site_id Optional Site ID, defaults to current site.
*/ */
public function __construct( $id = 0, $name = '', $site_id = '' ) { public function __construct( $id = 0, $name = '', $site_id = '' ) {
global $wpdb;
if ( ! isset( self::$back_compat_keys ) ) { if ( ! isset( self::$back_compat_keys ) ) {
$prefix = $GLOBALS['wpdb']->prefix; $prefix = $wpdb->prefix;
self::$back_compat_keys = array( self::$back_compat_keys = array(
'user_firstname' => 'first_name', 'user_firstname' => 'first_name',
'user_lastname' => 'last_name', 'user_lastname' => 'last_name',

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.