[wp-trac] [WordPress Trac] #19041: function to list all (true) conditionals (in an array)
WordPress Trac
wp-trac at lists.automattic.com
Mon Jun 4 22:46:32 UTC 2012
#19041: function to list all (true) conditionals (in an array)
-----------------------------------+------------------------------
Reporter: F J Kaiser | Owner: F J Kaiser
Type: enhancement | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 3.3
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion |
-----------------------------------+------------------------------
Comment (by scribu):
On the one hand, I also have a function that does something very similar,
so I know that this would be useful at least to some people. On the other
hand, it's pretty easy to implement outside of Core.
There are a few problems with the patch:
* it only works on the main WP_Query instance; it should be a WP_Query
method instead.
* it uses preg_match(), when a simple `'is_' == substr( $key, 0, 3 )`
would do.
* it casts WP_Query to an array, instead of using get_object_vars().
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19041#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list