简体   繁体   English

如何授予自定义用户权限以允许从Wordpress中的后端访问插件配置

[英]How to give permission for the custom users to allow to access plugin configuration from backend in wordpress

I have written a plugin. 我已经写了一个插件。 Their admin can access it and do the plugin configuration. 他们的管理员可以访问它并进行插件配置。 Now I need to give this permission for the particular users I created to access and configure the plugin. 现在,我需要为我创建的用于访问和配置插件的特定用户授予此权限。

Problem is I don't need them to access other configurations in back-end such as page creation, user creation, plugin installation and etc. 问题是我不需要他们访问后端的其他配置,例如页面创建,用户创建,插件安装等。

I have added the plugin to the setting menu in wordpress backend. 我已将插件添加到wordpress后端的设置菜单中。

So how to set permission from plugin code to allow configuration from back-end only for my plugin? 那么,如何设置插件代码的权限,以仅允许我的插件从后端进行配置?

最好将您的插件菜单放置在具有add_management_page工具”下,并将capability参数设置为与所需用户角色匹配的参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM