Change WordPress user roles and capabilities › Forums › Restrict or Permit access inside WordPress – how to › Editor Role adding access to Menu and Widgets › Reply To: Editor Role adding access to Menu and Widgets
20/10/2017 at 02:41
#4309
Vladimir
Keymaster
Redirection plugin uses ‘administrator’ role by default to protect its menu and pages.
Fortunately, plugin author makes this via custom filter ‘redirection_role’. So it’s possible to use any custom capability instead of administrator role to provide access to this plugin for user with other role.
For example, add new user capability ‘edit_redirections’. Grant it to the ‘Editor’ role. Add custom code below to your active theme functions.php file or install it as a Must Use plugin.
add_filter('redirection_role', 'change_redirection_role', 10, 1);
function change_redirection_role($role) {
$cap = 'edit_redirections';
return $cap;
}