[wp-trac] [WordPress Trac] #16735: Querying against empty meta_value should work

WordPress Trac wp-trac at lists.automattic.com
Thu Mar 3 00:42:44 UTC 2011


#16735: Querying against empty meta_value should work
--------------------------+-----------------------------
 Reporter:  scribu        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 This should work:

 {{{
       $args = array(
         'meta_query' => array(
           array(
             'key' => 'featured_image',
             'value' => '',
             'compare' => '!='
           )
         )
       );
       $query = new WP_Query( $args );
 }}}

 Source: http://wordpress.stackexchange.com/questions/10881/how-can-i-show-
 posts-only-if-meta-value-is-not-empty

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16735>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list