Home › Forums › ACF PRO › WP_User_Query issue › Reply To: WP_User_Query issue
Already fixed. It was because of nested field in meta key, for example, if you have cite field inside left_column group field, you shoud set key as left_column_city.
And the second issue i used meta_key instead of key.
So the right arguments should be like this:
$args = array (
'role' => 'subscriber',
'order' => 'ASC',
'orderby' => 'display_name',
'number' => $num,
'offset' => $offset,
'meta_query' => array(
'relation' => 'AND',
)
);
if($city != ''){
$args['meta_query'][] = array(
array(
'key' => 'left_column_city',
'value' => $city,
'compare' => 'LIKE',
),
);
}
if($loc != ''){
$args['meta_query'][] = array(
array(
'key' => 'left_column_state',
'value' => $loc,
'compare' => '=',
),
);
}
if($cat != ''){
$args['meta_query'][] = array(
array(
'key' => 'left_column_specialties',
'value' => $cat,
'compare' => 'LIKE'
)
);
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.