[wp-trac] [WordPress Trac] #11482: Add LIKE to meta_compare
WordPress Trac
wp-trac at lists.automattic.com
Fri Dec 18 18:47:43 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):
If it used like_escape, there would need to be a different way of passing
the "%"s instead of meta_value, as if it does like_escape( $meta_value )
the "%" will be escaped.
In terms of not doing it in favour of using posts_join, I feel is a bit of
a workaround, hooking into posts_join, checking if the join has been
added, then hooking into posts_where and inserting the LIKE statement
seems like a lot of work compared to a proper implementation of using LIKE
as a meta_compare. Especially as currently the posts_join and posts_where
filters don't give you access to the WP_Query object it is a pain to check
for query vars etc (global $wp_query not included).
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11482#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list