[wp-trac] [WordPress Trac] #18736: Add REGEXP to 'compare' values in meta_query
WordPress Trac
wp-trac at lists.automattic.com
Tue Aug 21 21:32:19 UTC 2012
#18736: Add REGEXP to 'compare' values in meta_query
-------------------------+------------------------------
Reporter: FlashUK | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version: 3.2.1
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+------------------------------
Comment (by wonderboymusic):
To log SQL:
{{{
update_post_meta( 1, 'num_as_longtext', 123 );
update_post_meta( 2, 'num_as_longtext', 99 );
add_filter( 'query', function ( $sql ) { error_log( $sql ); return $sql; }
);
new WP_Query( array( 'post_type' => 'any', 'meta_type' => 'UNSIGNED',
'meta_compare' => 'REGEXP', 'meta_key' => 'num_as_longtext', 'meta_value'
=> '^1' ) );
exit();
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18736#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list