admin管理员组文章数量:1390964
My code:
if ($sri) {
$sri = intval($sri);
$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' => 'NOT EXISTS',
// ],
// [
// 'key' => 'related_post_id2',
// 'value' => '',
// 'compare' => '='
// ],
// [
// 'key' => 'related_post_id2',
// 'value' => null,
// 'compare' => '='
//
// ],
// [
// 'key' => 'related_post_id2',
// 'value' => 'NULL',
// 'compare' => '='
//
// ]
// ]
],
'meta_key' => 'send_at',
'orderby' => 'meta_value',
'order' => 'DESC'
];
$posts = get_posts($args);
d($posts);
die('bb');
the commented out part of the code doesn't work
even though the value is clearly NULL
Wordpress is of 2020 so not old... version 5.3
本文标签: Check for not NULL not working in meta query
版权声明:本文标题:Check for not NULL not working in meta query 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744752688a2623274.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论