Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#55226 closed enhancement (fixed)

Update class-wp-site-query.php - Change function parse_orderby()

Reported by: lenasterg's profile lenasterg Owned by: peterwilsoncc's profile peterwilsoncc
Milestone: 6.0 Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: has-patch
Focuses: Cc:

Description

This is a follow-up to #26580.
Currently there isn't allowed to sort the site query based on the 'deleted' field which is striped from the "orderby" keys due to parse_orderby() function.

In order to have plugins that give the ability to add filters to the sites list to sort deleted/active sites, we need the 'deleted' field of wp_blogs table to be sortable.

A possible solution suggestion into the following PR

https://github.com/WordPress/wordpress-develop/pull/2345

Change History (8)

This ticket was mentioned in PR #2345 on WordPress/wordpress-develop by lenasterg.


2 years ago
#1

  • Keywords has-patch added

Addition to function parse_orderby()
the case 'deleted'
This is useful in order to allow the sites to be sortable based on the 'deleted' field column.

Trac ticket: https://core.trac.wordpress.org/ticket/55226

#2 @SergeyBiryukov
2 years ago

  • Milestone changed from Awaiting Review to 6.0

#3 follow-up: @peterwilsoncc
2 years ago

To try and avoid followup tickets, is the same needed for any/all of the other boolean fields in the table: mature, spam, archived, public?

#4 in reply to: ↑ 3 @lenasterg
2 years ago

Hi,
I think you are right about that. It's better to do it for all the fieldes.

Replying to peterwilsoncc:

To try and avoid followup tickets, is the same needed for any/all of the other boolean fields in the table: mature, spam, archived, public?

This ticket was mentioned in Slack in #core by costdev. View the logs.


2 years ago

#6 @peterwilsoncc
2 years ago

@lenasterg I've pushed some additional commits to your branch to add the additional booleans and include them in the documentation.

#7 @peterwilsoncc
2 years ago

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

In 53107:

Networks and Sites: Increase sort options in WP_Site_Query.

Add orderby support for the boolean options: deleted, spam, mature, archived and public.

Props lenasterg, SergeyBiryukov.
Fixes #55226.

Note: See TracTickets for help on using tickets.