mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-03 08:40:10 +00: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. git-svn-id: https://develop.svn.wordpress.org/trunk@54119 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user