Thanks Daniel for your help!
After dumping it, this is what I get (attached image)
“Role” does not appear… and I don’t know where to find it.
I also tried this code, getting the role from the user ID (112 is the id of a user on the list) and it works, but I don’t know how to pass the user ID as a parameter.
<h3>Asistentes</h3> <div> <?php $users = get_field('asistentes'); ?> <ul> <?php foreach ($users as $user): ?> <li> <p><?php echo $user['display_name']; ?> - <?php $user_info = get_userdata(112); echo 'User roles: ' . implode(', ', $user_info->roles) . "\n"; ?></p> </li> <?php endforeach; ?> </div>
I think I’m getting closer… What am I missing?
Thanks in advance!
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!
© 2022 Advanced Custom Fields.