How do I remove dashboard access from specific user roles?

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? 4 To lock subscribers and contributors out of the admin: function wpse23007_redirect(){ if( is_admin() && !defined(‘DOING_AJAX’) && ( current_user_can(‘subscriber’) … Read more

How to allow editor to edit privacy page / settings only?

In my WordPress installation (4.9.8.) the editor role isn’t allowed to edit the privacy page. It would work with following in my functions.php: $role_object = get_role( ‘editor’ ); $role_object->add_cap( ‘manage_privacy_options’, true ); $role_object->add_cap( ‘manage_options’ ); // this needs to be active in order that before cap works But now the editor has lot more rights … Read more

Remove Ability for Other Users to View Administrator in User List?

(Moderator’s note: Original title was “Remove Admin from User Menu”) I have created a client administrator role which is essentially an Editor with ability to add/remove users. The article “Editor can create any new user except administrator” was excellent in helping keep my new client admin role from editing or creating a True admin user. … Read more

How to get role of user

I need to get the role associated with a user — not the “currently logged in user”. I am using Buddypress (not that should matter to the nature of this question) and I am in the bp_members() loop. How can I retrieve the role of the user I am reporting on in the loop at … Read more

Remove update nags for non-admins [duplicate]

This question already has answers here: Remove Update Notification (for all users except ADMIN) (2 answers) Closed 4 years ago. I’m trying to remove or hide the update nags for non-admin users. As an admin, I see: The popular answer I’ve seen to handle this says to use: function hide_update_nag() { if ( !current_user_can(‘update_core’) ) … Read more