I’d like to prevent certain user roles from accessing the dashboard http://www.openeye.net/wp-admin/ at all. I’ve moved and restyled user profiles to a new page that’s viewable on the site. How would I go about doing this?
Leave a Reply
You must be logged in to post a comment.
To lock subscribers and contributors out of the admin:
Hope that helps. All roles give the user a capability that is the name of that role, so you can use any role name as a capability.
Yes, you would need to use the current_user_can( $capability ) function. Here is the official WordPress reference:
https://codex.wordpress.org/Function_Reference/current_user_can