[wp-trac] [WordPress Trac] #16796: _parse_meta_query with value 0

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 8 15:24:46 UTC 2011


#16796: _parse_meta_query with value 0
--------------------------+-----------------------------
 Reporter:  ptietz        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:  3.1
 Severity:  normal        |   Keywords:  needs-patch
--------------------------+-----------------------------
 Hey, guys.

 i found this when writing a hotel search, where you can search by stars,
 which is actually a custom field.

 So I created a little search script using WP_Query, which is now
 supporting "meta_query" since WP 3.1.

 But if there are 0 stars set, the meta_value is ignored.
 This is because of what's happening in '''meta.php on line 461''', where
 the actual value "0" fails the !empty() condition.

 Hope, this helps. Greetings from Germany!

 (PS: This is my first bug report, so please excuse me, if I have done
 something wrong)

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


More information about the wp-trac mailing list