Users role and User metadata
In WordPress, each registered user is assigned a role, which is limited to only a certain set of capabilities. We have covered this already under the ‘Roles and Capabilities’ topic in this lesson. All this information about the users is stored in the user meta table. You can learn more about them from the below resources –
- Users from Plugin Handbook
- Working with user metadata
It’s worth noting that like post metadata, get_user_meta() will return an array of multiple values for a single key unless the final value “$single” is set to true.
Ideas to Explore:
- What is the map_meta_cap() function? Write an example to showcase its usage.
- What is the map_meta_cap filter? Write an example to showcase its usage.