[wp-trac] [WordPress Trac] #14997: Single filter for all WP_Query clauses
WordPress Trac
wp-trac at lists.automattic.com
Wed Oct 13 13:18:15 UTC 2010
#14997: Single filter for all WP_Query clauses
-------------------------+--------------------------------------------------
Reporter: scribu | Owner:
Type: enhancement | Status: reopened
Priority: normal | Milestone: 3.1
Component: Query | Version:
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+--------------------------------------------------
Comment(by nacin):
Two things I'm noticing here.
One, I don't know if I like that the order of the filters was changed. I
have previously used the posts_where filter to add a callback to
posts_join if necessary. While those haven't swapped locations, other
individuals could have done something that is based on the order of
operations as they had been applied. It's purely for readability purposes
-- it's not necessary to move them.
Two, the logic there could be improved by using compact(). At most, I
would suggest the following: compact() the arguments, then before
extracting them, check that each index is set. If not all are set, then
refuse to unset/extract. Otherwise, unset and extract.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14997#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list