views:

12

answers:

1

I have a plugin installed in my wordpress site which allows user logins as contributor. But the settings tab for this plugin appears even if user logins as contributors. Is there a quick way to make sure the plugin settings appear only for administrators?

A: 

In the function where you register the plugin settings page, there's an argument for capability. Setting that to a higher capability (I usually use 'manage_options') prevents unauthorized access. For example:

add_options_page( 'My Options Page', 'My Options Page', 'manage_options', 'my-options-page', 'function_to_render_page' );

For more information, see the WordPress codex page on adding administration pages:

http://codex.wordpress.org/Adding_Administration_Menus

John P Bloch