Create sub-administrator role that can do everything except use or see the code editor


I am doing the code work for a website that someone else will be managing. I’m worried that just telling them not to use the code editor for appearance or plugins won’t be enough to stop them from doing so.

I’ve tried the standard WordPress add_role( $role, $title, $capability ) but I can’t figure out what combination of terms will allow them to edit pages, posts, post types, add or remove plugins, add and remove users, AND edit the WordPress customizer. I also want to make sure this user role can’t delete users with the administrator role.

This didn’t do the job:

add_role( 'sub_admin_role', 'Sub-Admin', array( 'level_7' => true ) );
Justin Barrett 2 years 2020-10-23T16:10:31-05:00 0 Answers 19 views 0

Leave an answer