WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 7 months ago

#25285 closed enhancement (fixed)

Filter query arguments passed to a new WP_User_Query()

Reported by: jeremyfelt Owned by:
Milestone: 4.0 Priority: normal
Severity: normal Version:
Component: Users Keywords: has-patch needs-refresh
Focuses: Cc:

Description

The queries created by WP_Users_List_Table and WP_MS_Users_List_Table don't allow for modification before the final SQL statements are generated. By adding a filter to the query arguments accepted in the __construct() method of WP_User_Query(), we have more control over what results are returned.

Attached patch has the included filter. It may be helpful to discuss where else this filter (or action) would belong if __construct() is not the right place for it.

Attachments (2)

25285.diff (554 bytes) - added by jeremyfelt 3 years ago.
25285.2.diff (625 bytes) - added by DrewAPicture 3 years ago.
period + @param

Download all attachments as: .zip

Change History (8)

@jeremyfelt
3 years ago

#1 @SergeyBiryukov
3 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
3 years ago

  • Type changed from defect (bug) to enhancement

@DrewAPicture
3 years ago

period + @param

#3 @DrewAPicture
3 years ago

25285.2.diff adds a period to the short description and an @param line for $query. We'll leave it up to the constructor to document the accepted arguments.

#4 @Jesper800
3 years ago

  • Cc jeve0@… added

#5 @chriscct7
7 months ago

  • Keywords needs-refresh added

#6 @wonderboymusic
7 months ago

  • Milestone changed from Awaiting Review to 4.0
  • Resolution set to fixed
  • Status changed from new to closed

[29363] - pre_get_users action

Note: See TracTickets for help on using tickets.