最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Role and Capabilities: How do I allow user role to access theme options without enabling 'manage_options'?

programmeradmin7浏览0评论

I'd like to allow a certain user role to access the theme options only.

When I tried this in functions.php, nothing happened:

$limitedadmin = get_role('limitedadmin'); $limitedadmin->add_cap('edit_theme_options'); $limitedadmin->add_cap('edit_themes');

Then when I added this line to the above lines: $limitedadmin->add_cap('manage_options');, it gave the user role access to the theme options but also enabled access to several other options throughout the site like options to several plugins.

How can I just limit access to theme options?

发布评论

评论列表(0)

  1. 暂无评论