[wp-trac] [WordPress Trac] #49429: There seems to be no way to check query value for NULL

WordPress Trac noreply at wordpress.org
Fri Feb 14 11:39:14 UTC 2020


#49429: There seems to be no way to check query value for NULL
--------------------------------------+------------------------------
 Reporter:  Jossnaz                   |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Query                     |     Version:  5.3.2
 Severity:  normal                    |  Resolution:
 Keywords:  2nd-opinion dev-feedback  |     Focuses:
--------------------------------------+------------------------------
Changes (by valentinbora):

 * keywords:   => 2nd-opinion dev-feedback


Comment:

 Related: #18158

 I've tested this via WP CLI and haven't so far found a way to use "IS
 NULL" or "IS NOT NULL":

 {{{#!php
 wp eval 'get_posts([ "meta_query" => [ [ "key" => "my_meta_key", "compare"
 => "IS NULL" ] ] ]); global $wpdb; print_r( end($wpdb->queries) );'
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49429#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list