[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 04:57:57 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: General | Version: 5.3.2
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Comment (by Jossnaz):
my full query is this:
{{{#!php
<?php
$args = [
'post_type' => 'notification',
'numberposts' => -1,
'meta_query' => [
'relation' => 'AND',
[
'key' => 'send_at',
'value' => Ut::getMysqlTimestamp('now'),
'compare' => '<=',
],
// array(
// 'key' => 'was_sent',
// 'value' => '1',
// 'compare' => '=',
// ),
[
'key' => 'related_post_id',
'value' => $sri,
'compare' => '='
],
[
'key' => 'notification_type',
'value' => Notification::STORY_REQUEST_MAIN_TYPE,
'compare' => '='
],
[
'relation' => 'OR',
[
'key' => 'related_post_id2',
'value' => '',
'compare' => '='
],
[
'key' => 'related_post_id2',
'compare' => 'NOT EXISTS'
]
]
//TODO @@@ there is still an issue with the commented out
part of the query
],
'meta_key' => 'send_at',
'orderby' => 'meta_value',
'order' => 'DESC'
];
$posts = get_posts($args);
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49429#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list