I want to give my editors access to a settings page to a plugin I’ve installed on their website. As of now, it’s only visible to Administrators.
The plugin I’m using is uTubeVideo Gallery, and there is no option to give users other than administrators access.
In his admin.php I found these lines, which I know creates the settings page:
public function addMenus()
{
add_menu_page('uTubeVideo', 'uTubeVideo', 'manage_options', 'utubevideo_settings', array($this, 'option_panel'), plugins_url('utubevideo-gallery/i/utubevideo_icon_16x16.png'));
add_submenu_page('utubevideo_settings', 'uTubeVideo Galleries', __('Galleries', 'utvg'), 'manage_options', 'utubevideo_settings_galleries', array($this, 'gallery_panel'));
}
Is there a way for me to tweak his code so I can give access to editors?
The
manage_options
argument you see in both function calls is a capability. That particular capability makes the page accessible only to administrators.To make this work, you could change that to one of the editor capabilities like
edit_others_posts
You could also create a new capability and use that.However, doing either will mean hacking the plugin and the next time the plugin is updated your changes will be overwritten, which is why hacking plugins is generally a bad idea
I would:
settings page. “Editors” are logically a “content” role, not a
“global site administration” role, which is what you seem to be
partially converting them to.
simplified access to the plugin functionality.
limited and whether the author would be willing to change the plugin
code
Try with