It should be doable in a theme component. The user ID is available without an additional request, so you’d only need some JavaScript to show it in a plugin outlet on the profile page.
@pfaffman Thanks for the reply. Well, because a UID is immutable (never changes) it can act like a permanent fingerprint for someone’s account. Usernames can change so for support tickets it instantly can find their account, transactions, auth sessions etc… UID cannot be faked and are unique forever.
I would like the UID to increment by 1 with every new users
@Moin Thanks for the reply it was helpful. Yesd I can view the response in Network → XHR → Response. Perfect. But I am unaware as to how to show the UID on the users account profile. I want to display it here: https://mydomain.com/u//preferences/account
But within the create components there is only these options: , Before Header, After Header and Footer
/my/preferences/account is not public; other users cannot see that, but based on your use case, it might be enough for the user themselves to see their ID.
You need to find a plugin outlet that is close to where you want to show the information. I usually use the button in the developer toolbar to make them visible on a forum. Seeing them within the forum makes it easier for me to find the best outlet. You can find more information on how to show something in an outlet in the Theme Developer Tutorial: 1. Introduction
Okay so if I want everyone to see it (public) I would place it within: mydomain.com/u/<user>summary
So by use of enableDevTools() within the browser console I think user-profile-secondary will be a good place.
I will try now.
Im stuck. How would I get the id of the user I am viewing? Because api.getCurrentUser does the logged in user.
I just put the User ID on plugin outlet: header-contents__after