I would like to write some arguments for my query and both need to be true. I am having trouble with the Syntax.
'meta_key' => $campaign_type,
'meta_value' => $Campaign_ID,
AND
'meta_key' => 'organisation',
'meta_value' => $userOrg,
Below is my query code:
$args = array (
'meta_query' => array(
'relation' => 'AND',
array(
'meta_key' => $campaign_type,
'meta_value' => $Campaign_ID,
'compare' => '='
),
array(
'meta_key' => 'organisation',
'meta_value' => $userOrg,
'compare' => '='
)
));
Thank you.
meta_query
withWP_User_Query
- just take a look at Codex ;)