[wp-trac] [WordPress Trac] #9124: meta_compare needs to allow "in" as well
WordPress Trac
wp-trac at lists.automattic.com
Sun Aug 16 07:19:06 UTC 2009
#9124: meta_compare needs to allow "in" as well
-------------------------+--------------------------------------------------
Reporter: Otto42 | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone: 2.9
Component: Query | Version: 2.7
Severity: normal | Keywords: has-patch needs-testing
-------------------------+--------------------------------------------------
Changes (by dd32):
* keywords: has-patch => has-patch needs-testing
Comment:
Testings:
{{{
get_posts( array( 'meta_key' => '_test', 'meta_value' => range(1,4),
'meta_compare' => 'in') );
string(158) " AND wp3_posts.post_type = 'post' AND (wp3_posts.post_status
= 'publish') AND wp3_postmeta.meta_key = '_test' AND
wp3_postmeta.meta_value IN('1','2','3','4') "
get_posts( array( 'meta_key' => '_test', 'meta_value' => 'test, test2,
test3', 'meta_compare' => 'in') );
string(165) " AND wp3_posts.post_type = 'post' AND (wp3_posts.post_status
= 'publish') AND wp3_postmeta.meta_key = '_test' AND
wp3_postmeta.meta_value IN('test','test2','test3') "
get_posts( array( 'meta_key' => '_test', 'meta_value' => 'test, test2,
test3') );
string(161) " AND wp3_posts.post_type = 'post' AND (wp3_posts.post_status
= 'publish') AND wp3_postmeta.meta_key = '_test' AND
wp3_postmeta.meta_value = 'test, test2, test3' "
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9124#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list