Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years 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 2 years ago.

Download all attachments as: .zip

Change History (5)

@shoaibkarimali
2 years ago

#1 @shoaibkarimali
2 years ago

  • Keywords has-patch added

Replaced DocBlock global tag $blog_id with $wp_roles.

#2 @SergeyBiryukov
2 years 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
2 years 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
2 years ago

@SergeyBiryukov Thank you for reviewing the patch.

Note: See TracTickets for help on using tickets.