I'm using the Redirection plugin. It enables a 'Redirection' submenu under "Tools" menu in Admin panel. As an Administrator I can access the plugin. But I want to avail it for my 'editor' accounts too.
I've searched a lot, but found solution like this that are offering solution like editing the plugin itself. I actually don't want to edit plugin files directly, as on next update all the changes will wipe out.
So, how can I let the 'editor' get access to the 'Redirection' submenu under 'Tools' menu?
I'm using the Redirection plugin. It enables a 'Redirection' submenu under "Tools" menu in Admin panel. As an Administrator I can access the plugin. But I want to avail it for my 'editor' accounts too.
I've searched a lot, but found solution like this that are offering solution like editing the plugin itself. I actually don't want to edit plugin files directly, as on next update all the changes will wipe out.
So, how can I let the 'editor' get access to the 'Redirection' submenu under 'Tools' menu?
Share Improve this question asked Sep 8, 2015 at 17:14 Mayeenul IslamMayeenul Islam 12.9k21 gold badges85 silver badges169 bronze badges2 Answers
Reset to default 15Update 2020
The original answer was of 2015, and the author has no affiliation with the plugin, so not aware of any changes to the plugin at all. You are requested to follow any updated helpful answer that might help you on this issue.
Original Answer
Good news is, from version 2.3.7 of Redirection plugin, they introduced a filter called redirection_role
for the privilege. Here's is the core code (v.2.3.7):
add_management_page( __( "Redirection", 'redirection' ), __( "Redirection", 'redirection' ), apply_filters( 'redirection_role', 'administrator' ), basename( __FILE__ ), array( &$this, "admin_screen" ) );
###Solution
Just put the following code into your theme's functions.php
to enable 'editor' to get access to the 'Redirection' submenu:
/**
* Redirection Plugin Editor access
*/
add_filter( 'redirection_role', 'redirection_to_editor' );
function redirection_to_editor() {
return 'edit_pages';
}
See Editor user role and capabilities in WordPress - WordPress Codex
The answer from @mayeenul-islam is very useful but I don't have enough rep points to vote or comment on it.
Since that answer was published, the Redirection plugin uses REST-API and this can give permission errors even though the function allows access to Editors.
In my case, using Redirection version 3.5, I solved the problem by changing the REST-API setting in the Redirection Options from 'Default /wp-json' to 'Proxy over Admin AJAX'.