Archived topic
Limit access to Theme options menu
3 replies · Started by Ladislav Blažek on September 8, 2014
Hi Tom,
is there any way how to limit access to GeneratePress options menu (wp-admin/themes.php?page=generate-options) in admin area? Basically I am looking for functionality where my users are able to customize colors/fonts etc. in theme customizer but don't have possibility to mess with addon activation.
I was trying to achieve that with "User Role Editor" plugin but removing "edit_theme_options" rights will also remove customizer....
This should do this:
add_action('after_setup_theme','generate_hide_generatepress');
function generate_hide_generatepress()
{
remove_action('admin_menu', 'generate_create_menu');
}
Let me know if you have any questions :)
Hi Tom. Combined with condition checking 'activate_plugins' capability works exactly I need! Thanks a lot!
add_action('after_setup_theme','generate_hide_generatepress');
function generate_hide_generatepress()
{
if (current_user_can('activate_plugins') == false) {
remove_action('admin_menu', 'generate_create_menu');
}
}
Awesome!