mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 05:31:25 +01:00
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:
parent
70c0f6f0e1
commit
1a37650766
@ -141,7 +141,7 @@ class WP_User_Query {
|
|||||||
* @since 5.9.0 Added 'capability', 'capability__in', and 'capability__not_in' parameters.
|
* @since 5.9.0 Added 'capability', 'capability__in', and 'capability__not_in' parameters.
|
||||||
*
|
*
|
||||||
* @global wpdb $wpdb WordPress database abstraction object.
|
* @global wpdb $wpdb WordPress database abstraction object.
|
||||||
* @global int $blog_id
|
* @global WP_Roles $wp_roles WordPress role management object.
|
||||||
*
|
*
|
||||||
* @param string|array $query {
|
* @param string|array $query {
|
||||||
* Optional. Array or string of Query parameters.
|
* Optional. Array or string of Query parameters.
|
||||||
@ -256,7 +256,7 @@ class WP_User_Query {
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
public function prepare_query( $query = array() ) {
|
public function prepare_query( $query = array() ) {
|
||||||
global $wpdb;
|
global $wpdb, $wp_roles;
|
||||||
|
|
||||||
if ( empty( $this->query_vars ) || ! empty( $query ) ) {
|
if ( empty( $this->query_vars ) || ! empty( $query ) ) {
|
||||||
$this->query_limit = null;
|
$this->query_limit = null;
|
||||||
@ -448,8 +448,6 @@ class WP_User_Query {
|
|||||||
$available_roles = array();
|
$available_roles = array();
|
||||||
|
|
||||||
if ( ! empty( $qv['capability'] ) || ! empty( $qv['capability__in'] ) || ! empty( $qv['capability__not_in'] ) ) {
|
if ( ! empty( $qv['capability'] ) || ! empty( $qv['capability__in'] ) || ! empty( $qv['capability__not_in'] ) ) {
|
||||||
global $wp_roles;
|
|
||||||
|
|
||||||
$wp_roles->for_site( $blog_id );
|
$wp_roles->for_site( $blog_id );
|
||||||
$available_roles = $wp_roles->roles;
|
$available_roles = $wp_roles->roles;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user