Docs: Correct @global tags in WP_User_Query::prepare_query().

* `$blog_id` global was replaced with `get_current_blog_id()` and is no longer used directly.
* `$wp_roles` global usage was previously undocumented.

Follow-up to [32637], [38457], [51943].

Props shoaibkarimali.
Fixes #56543.
Built from https://develop.svn.wordpress.org/trunk@54119


git-svn-id: http://core.svn.wordpress.org/trunk@53678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-09-11 13:13:12 +00:00
parent 70c0f6f0e1
commit 1a37650766
2 changed files with 4 additions and 6 deletions

View File

@ -140,8 +140,8 @@ class WP_User_Query {
* @since 5.3.0 Introduced the 'meta_type_key' parameter.
* @since 5.9.0 Added 'capability', 'capability__in', and 'capability__not_in' parameters.
*
* @global wpdb $wpdb WordPress database abstraction object.
* @global int $blog_id
* @global wpdb $wpdb WordPress database abstraction object.
* @global WP_Roles $wp_roles WordPress role management object.
*
* @param string|array $query {
* Optional. Array or string of Query parameters.
@ -256,7 +256,7 @@ class WP_User_Query {
* }
*/
public function prepare_query( $query = array() ) {
global $wpdb;
global $wpdb, $wp_roles;
if ( empty( $this->query_vars ) || ! empty( $query ) ) {
$this->query_limit = null;
@ -448,8 +448,6 @@ class WP_User_Query {
$available_roles = array();
if ( ! empty( $qv['capability'] ) || ! empty( $qv['capability__in'] ) || ! empty( $qv['capability__not_in'] ) ) {
global $wp_roles;
$wp_roles->for_site( $blog_id );
$available_roles = $wp_roles->roles;
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-54118';
$wp_version = '6.1-alpha-54119';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.