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

php - How to give custom roles the capability to edit one Menu instead of every Menu

programmeradmin0浏览0评论

I would like to have a custom user role that can edit the Menu items under the Appearance tab. But I don't want my custom role to have the ability to edit every menu on my WordPress site. I only want this role to be able to edit a single menu. For example, in the screenshot below I want my user role to only be able to see and edit Menu A. I don't want my role to see and edit the Header, Footer, or any other menus. I have searched other Stackoverflow questions like the one in this link: allow editors to edit menus?

But that solution allows the role to access every menu on my Wordpress site. In fact, that solution allows the role to access other Appearance functionalities like the ability to customize the theme itself, which I don't want.

I would prefer to solve this problem by writing my own PHP code instead of using an external plugin, although any help would be much appreciated.

发布评论

评论列表(0)

  1. 暂无评论