WordPress.org

Make WordPress Core

Opened 23 months ago

Last modified 22 months ago

#37641 new enhancement

Support queries on `spam` and `deleted` fields in `WP_User_Query` on multisite

Reported by: flixos90 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.1
Component: Users Keywords: has-patch has-unit-tests
Focuses: multisite Cc:

Description

The users database table on multisite contains two additional fields spam and deleted which need to be queried in some cases. For example the function wp_update_network_user_counts() makes a direct SQL query at the moment, but that could be improved if WP_User_Query supported these fields (only on multisite that is).

Attachments (1)

37641.diff (4.8 KB) - added by flixos90 23 months ago.

Download all attachments as: .zip

Change History (4)

@flixos90
23 months ago

#1 @flixos90
23 months ago

  • Keywords has-patch has-unit-tests added; needs-patch removed

37641.diff adds support for these fields to WP_User_Query. Unit tests are also included.

#2 follow-up: @thomaswm
23 months ago

It has been suggested in #34316 to remove the spam and deleted fields from the users database table and introduce a user status API instead.

#3 in reply to: ↑ 2 @flixos90
22 months ago

Replying to thomaswm:

It has been suggested in #34316 to remove the spam and deleted fields from the users database table and introduce a user status API instead.

Okay, makes sense. Let's leave this ticket open, but hold off until we decide which direction #34316 is gonna take. While the changes here would be helpful enhancements for the current state, they probably shouldn't be added if we're gonna change the functionality altogether.

Note: See TracTickets for help on using tickets.