I'm trying to write PHP code that loops through all WordPress users and fetches information out of their Ultimate Member profile. Looping through all WP users is the easy part and I have that covered.
The Ultimate Member codex provides a um_user() function to fetch the currently logged in user, and a um_fetch_user() function for retrieving a UM user given an Ultimate Member user ID, but I can't find any way to determine a user's UM ID based on their WordPress ID: neither the WP user profile nor the WP meta seem to contain a UM user ID.
How can I retrieve a UM user record if I only have its WordPress user ID? Alternately, how can I retrieve UM user data for all users?