Differences between plugin and add_cap() function
-
Helo
I don’t understand one thing. I would like the user to have access to the list of users (without administrators).
When I do something like this:
add_role( ‘testrole’, ‘testrole’);$test_role = get_role(‘testrole’);
$test_role->add_cap(‘list_users’);the user also sees administrators in the user list.
When I add a role using the User Role Editor plugin and add list_users cap, the user has access to the list of regular users only.
What is the difference between these two situations?
Additionally, if I add a role via code, all I have to do is enable the plugin so that only regular users appear in the list (without admins).
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Differences between plugin and add_cap() function’ is closed to new replies.