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

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 22 15:47:36 UTC 2011


#18158: Meta Query for posts with a meta key not set.
-------------------------+-----------------------------
 Reporter:  johnnyb      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Query        |     Version:  3.2.1
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |
-------------------------+-----------------------------

Comment (by scribu):

 Actually, this should work:

 {{{
 ... LEFT JOIN wp_postmeta as m1
 ... AND m1.meta_key IS NULL
 }}}

 This can be done for as many queries as necessary.

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


More information about the wp-trac mailing list