[wp-trac] [WordPress Trac] #18158: Meta Query for posts with a meta key not set (IS NULL).

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 26 01:08:25 UTC 2012


#18158: Meta Query for posts with a meta key not set (IS NULL).
-------------------------------------+------------------------------
 Reporter:  johnnyb                  |       Owner:  georgestephanis
     Type:  enhancement              |      Status:  accepted
 Priority:  normal                   |   Milestone:  3.4
Component:  Query                    |     Version:  3.2.1
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing has-patch  |
-------------------------------------+------------------------------

Comment (by scribu):

 Example usage:

 {{{
 $q = new WP_Query( array(
         'meta_query' => array(
                 array(
                         'key' => 'foo',
                         'compare' => 'EXISTS'
                 ),
                 array(
                         'key' => 'bar',
                         'compare' => 'NOT EXISTS'
                 )
         )
 ) );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18158#comment:25>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list