Home › Forums › ACF PRO › user relationship field query – how to? › Reply To: user relationship field query – how to?
I think i have to do a user query like this:
– getting all users
– check if the user IDs are equal to an ID in the custom field entrys added to the page
– than drop the ones whos ID is not in
EDIT: this is the solution. So simple that I could not get it 😀
<?php
//get the users
$ids = get_field('personen_intern', false, false);
//include them in the query
$args = array(
'include' => $ids,
);
?>
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.