Make WordPress Core

Changeset 54119


Ignore:
Timestamp:
09/11/2022 01:11:33 PM (19 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-user-query.php

    r53655 r54119  
    141141     * @since 5.9.0 Added 'capability', 'capability__in', and 'capability__not_in' parameters.
    142142     *
    143      * @global wpdb $wpdb WordPress database abstraction object.
    144      * @global int  $blog_id
     143     * @global wpdb     $wpdb    WordPress database abstraction object.
     144     * @global WP_Roles $wp_roles WordPress role management object.
    145145     *
    146146     * @param string|array $query {
     
    257257     */
    258258    public function prepare_query( $query = array() ) {
    259         global $wpdb;
     259        global $wpdb, $wp_roles;
    260260
    261261        if ( empty( $this->query_vars ) || ! empty( $query ) ) {
     
    449449
    450450        if ( ! empty( $qv['capability'] ) || ! empty( $qv['capability__in'] ) || ! empty( $qv['capability__not_in'] ) ) {
    451             global $wp_roles;
    452 
    453451            $wp_roles->for_site( $blog_id );
    454452            $available_roles = $wp_roles->roles;
Note: See TracChangeset for help on using the changeset viewer.