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

WordPress Trac wp-trac at lists.automattic.com
Thu Oct 27 07:30: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 markoheijnen):

 I was playing with it. I am not sure what the solution will be. The query
 now is pretty hard since it does a INNER JOIN on all meta keys/values. So
 a WHERE seems not to be possible.

 How I see it there should be an join on the post_meta table and join on
 the meta key. Somehow that looks like an ugly solution to me since you
 need te keep track on the naming of it.
 For a singular meta-query you can do only one join to the post_meta table
 I guess.

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


More information about the wp-trac mailing list