I am working on a php program and need to retrieve a list of users that have a specific custom capability. I have done quite a bit of searching through the codex and have only been able to find functions that require me to know the user ID already or default to the current user if not passed. I was able to find a shortcode that does part of what I want and put it in my php like this: $ccap_results = do_shortcode( “[s2Member-List ccaps=’$myccap’ /]” ); However, when I dump the results I get the users avatars with their names underneath and it is the correct list of users - but how do I pull out the list of user IDs from this? I don’t want to display this on a page - I just need the IDs in order to update other information for the list of users.
Thank you so much for your help!