admin管理员组文章数量:1406177
The intention is to search for customers who do not have coupon X or do not have any coupon.
$query = array (
'post_type' => 'clients',
'meta_query'=> array(
'relation' => 'OR',
array(
'key' => 'cupom',
'value' => $idCupom,
'compare' => '!=',
), array(
'key' => 'cupom',
'compare' => 'NOT EXISTS',
'value' => '',
)),
'posts_per_page' => -1,
);
I am doing according to other answers I found on the web, but the query returns wrong when it finds a post that has a meta_value different from the one searched.
本文标签: customizationQuerying posts that don39t have a certain key value or don39t have the key
版权声明:本文标题:customization - Querying posts that don't have a certain key value or don't have the key 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744971120a2635239.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论