Wordpress custom plugin not shown in roles except admin

柔情痞子 提交于 2019-12-25 08:15:57

问题


I wrote a custom wordpress plugin that is shown in the left menu bar in the backend of WP.

My problem is, that it is just shown if I log in as an administrator. If the editor logs in he can't see it. Is there any way that I can enable it so that every role can see it?

I tried to google the problem but didn't get any satisfying results, that's why I am asking it here.

Thanks for your answer!


回答1:


You need to set the proper capability, third parameter in the add_option_page() function which you would have used to create the menu.

http://codex.wordpress.org/Function_Reference/add_options_page



来源:https://stackoverflow.com/questions/10030123/wordpress-custom-plugin-not-shown-in-roles-except-admin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!