私はカスタムフィールドField Name: "participants"
とField Type: "User"
を持っています。Wordpress WP_Query "NOT IN"が動作しない
メタ問合せで「NOT IN」を使用したいが、機能していない。
$getUid = $_REQUEST['uid'];
$args = [
'post_type' => 'polls',
'post_status' => 'publish',
'meta_query' => [
'relation' => 'AND',
[
'key' => 'participants',
'value' => [$getUid],
'compare' => "NOT IN"
]
]
];
$the_query = new WP_Query($args);
return $the_query;
あなたが上で手の込んだ "動作しません?"エラー出力、または予想と実際の結果は有用であり、必要不可欠です。 – Jacob