[wp-trac] [WordPress Trac] #19866: Allow specifications of any wp_posts field(s) in WP_Query

WordPress Trac noreply at wordpress.org
Mon Sep 16 07:27:40 UTC 2013


#19866: Allow specifications of any wp_posts field(s) in WP_Query
-------------------------+------------------
 Reporter:  bigdawggi    |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.7
Component:  Query        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------

Comment (by MikeSchinkel):

 Replying to [comment:6 nacin]:
 > Pretty terribly / it'll completely ignore it. Which is why I am not a
 huge fan of this — it is ripe for abuse and misunderstanding. ... Maybe
 direct queries is better advice for stuff like this?

 How do you feel about maybe modularizing `WPQuery->get_posts()` such that
 we would be able to get parts of a query more easily; specifically the
 `WHERE` and `JOIN` clauses without having to duplicate so much SQL logic?

 I know it would be a huge undertaking, but every time I have to debug into
 that function ''(which is often)'' I think of how much easier it would be
 to understand the behavior in specific areas if I didn't have to trace
 through 2000+ lines of code.

 On a related note it should would be nice if the components of the SQL
 queries were modeled as objects instead of as string fragments so that
 modifying them during hooks wouldn't be so fragile.  I spent an hour and
 wrote a proof of concept to illustrate what I mean:
 https://gist.github.com/mikeschinkel/6577595.

 I'd be happy to create new tickets for either of these if there's any
 chance of consideration.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/19866#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list