简体   繁体   English

WordPress的如何添加菜单到管理部分,并有权访问所有其他管理员

[英]Wordpress how to add menu to admin section and have access to all other admin

Can anyone please help me? 谁能帮帮我吗?

i have installed a word press and i have created a sub menu by name Manufacturer and have created a page but the page is accessed only in admin user but not with the other admin user which i have created. 我已经安装了一个单词印刷机,并且已经按制造商名称创建了一个子菜单并创建了一个页面,但是该页面只能在admin用户中访问,而不能与我创建的其他admin用户一起访问。 how to give access permission to that admin users? 如何授予该管理员用户访问权限? i am a beginner to php as well as word press please help me. 我是php以及word press的初学者,请帮助我。

When you create the admin panel page, you should give the proper permissions to the users, who you want to access it. 创建管理面板页面时,应将适当的权限授予要访问它的用户。 For example: 例如:

<?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>

So the important thing here is the $capability . 因此,这里重要的是$capability The $capability is string and is required for this menu to be displayed to the user. $capability是字符串,向用户显示此菜单是必需的。 User levels are deprecated and should not be used here! 不建议使用用户级别,因此请勿在此处使用! So the possible capabilities for regular users (ie Author and Contributor) are: 因此,普通用户(即作者和贡献者)的可能功能为:

Author 作者

  • delete_posts delete_posts
  • delete_published_posts delete_published_posts
  • edit_posts edit_posts
  • edit_published_posts edit_published_posts
  • publish_posts publish_posts
  • read
  • upload_files 上传文件

Contributor 贡献者

  • delete_posts delete_posts
  • edit_posts edit_posts
  • read

Use one of them when creating your admin page. 创建管理页面时,请使用其中之一。 Read more here and here . 在这里这里阅读更多。

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

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