[wp-trac] [WordPress Trac] #47642: Order by comment count - posts list tables

WordPress Trac noreply at wordpress.org
Fri Feb 4 13:52:15 UTC 2022


#47642: Order by comment count - posts list tables
-------------------------------------------------+-------------------------
 Reporter:  alektabor                            |       Owner:
                                                 |  johnbillion
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Posts, Post Types                    |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-screenshots has-patch early      |     Focuses:
  early-like-actually-early has-unit-tests       |  administration
-------------------------------------------------+-------------------------

Comment (by ramon fincken):

 So .. I have rewritten this. Resulting in less lines of code and better
 maintainable.

 The basic principle is that every query that actually HAS an order by
 request argument .. should have an ID.

 We have 3 cases where we do not add an ID: ID, rand and relevance. All
 others will have an ID added by this code.

 Unlike the loop in the last patches this will do a quick array_intersect.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47642#comment:47>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list