Make WordPress Core

Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#56543 closed defect (bug) (fixed)

Correct wrong `@global` tag in class WP_User_Query

Reported by: shoaibkarimali's profile shoaibkarimali Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.1 Priority: normal
Severity: normal Version: 6.0.2
Component: Query Keywords: has-patch
Focuses: docs Cc:

Description

The second @global tag in the DocBlocks for the method prepare_query() is wrong. Instead of $blog_id it should be $wp_roles.

Attachments (1)

56543.diff (745 bytes) - added by shoaibkarimali 21 months ago.

Download all attachments as: .zip

Change History (5)

#1 @shoaibkarimali
21 months ago

  • Keywords has-patch added

Replaced DocBlock global tag $blog_id with $wp_roles.

#2 @SergeyBiryukov
21 months ago

  • Milestone changed from Awaiting Review to 6.1

Hi there, welcome to WordPress Trac! Thanks for the ticket.

The patch looks good. Some history here:

  • @global tags were added in [32637].
  • $blog_id global usage was replaced with get_current_blog_id() in [38457].
  • $wp_roles global usage was added in [51943].

#3 @SergeyBiryukov
21 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 54119:

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.

#4 @shoaibkarimali
21 months ago

@SergeyBiryukov Thank you for reviewing the patch.

Note: See TracTickets for help on using tickets.