Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

add capability single plugin options for single role WordPress

  • SOLVED

I would like to give a specific user, eg, editor, the ability to see and be able to change the options of a *single* plugin.
The editor does not have the "manage options" capability with role manager.


The plugin is Featured Content Gallery
https://wordpress.org/plugins/featured-content-gallery/

and I wish that the editor to be able to make changes to the options page of the plugin (eg change the posts ID, etc).

The editor has level *10* with role manager and this is the code in the file featured-content-gallery/content-gallery.php




/* Adds our admin options under "Options" */
function gallery_options_page() {
add_options_page('Featured Content Gallery Options', 'Featured Content Gallery', 10, 'featured-content-gallery/options.php');
}



but it does not allow me to give the user the possibility to change options.


Answers (3)

2014-03-09

Francisco Javier Carazo Gil answers:

Have you tried it? https://wordpress.org/plugins/user-role-editor/


noronha comments:

Yes, but it does not allow me to create a capability specifically to display and change the options of that particular plugin.


Francisco Javier Carazo Gil comments:

You can do something like:


function my_menu(){
if(current_user_can('manage_options'))
add_options_page('Featured Content Gallery Options', 'Featured Content Gallery', 10, 'featured-content-gallery/options.php');
}
add_action('admin_menu', 'my_menu');

2014-03-09

Navjot Singh answers:

You can use [[LINK href="http://wordpress.org/plugins/adminimize/"]]Adminimize[[/LINK]] plugin to show that particular plugin page only to the Editor.


Navjot Singh comments:

You can first enable manage_options for Editor. Then hide all other plugin pages except Featured Content Gallery using Adminimize.

2014-03-09

Bob answers:

May be this one help
[[LINK href="http://wordpress.org/plugins/adminimize/"]]http://wordpress.org/plugins/adminimize/[[/LINK]]
they say
<blockquote>Admins can activate/deactivate every part of the menu and even parts of the submenu.</blockquote>


Bob comments:

convert 10 to 7
add_options_page('Featured Content Gallery Options', 'Featured Content Gallery', 7, 'featured-content-gallery/options.php');


Bob comments:

level 3 to 7 are different roles of editor.

I have tested it and menu working with editor role.


Bob comments:

oops I haven't installed role manager however try it. It might work.


Bob comments:

Are you using role manager for this to show this plugin only or it is being used for any other access?

which plugin you are using to manage role?

this one?
http://wordpress.org/plugins/wpfront-user-role-editor


noronha comments:

I use role manager to define the different roles and standard capability. Unfortunately the code you provided does not work (I tried it myself a few hours ago) but at this point I'll use Adminimize that will allow me to manage all the capabilities without going crazy with multiple codes that are likely to conflict with rolemanager.
Thank you all!