[wp-trac] [WordPress Trac] #11482: Add LIKE to meta_compare
WordPress Trac
wp-trac at lists.automattic.com
Fri Dec 18 19:16:09 UTC 2009
#11482: Add LIKE to meta_compare
-------------------------+--------------------------------------------------
Reporter: joehoyle | Owner: ryan
Type: enhancement | Status: new
Priority: normal | Milestone: 3.0
Component: Query | Version: 2.9
Severity: normal | Keywords: has-patch
-------------------------+--------------------------------------------------
Comment(by joehoyle):
> Just in case you're not aware that you can put AND clauses in a JOIN
statement, your example would be:
Ahh I was not aware you could do that, thanks!
> you can check the WP query in your plugin's function:
Again, learned another thing here, didn't know the current query was
stored in $wp_the_query (as I presume from the example it is)
Even so, not included LIKE in meta_compare on the grounds that there is
currently no function to easily sanitize the string seems wrong. Surely
WP_Query should be as powerful as possible (within reason, and not getting
in the way of ease of use) as WordPress is being used for more abstract
uses, especially when it comes to post_meta. Adding less than 20
characters to the query class to allow this, potentially very useful
enhancement (escape_like aside, as it seems that needs attention
regardless).
Just thinking out loud, but it just seems like a natural progression for
the class.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11482#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list