Customize Modify Permissions of WordPress Roles without Plugins

Posted in:
Update time:2018-12-30

We offer WordPress Themes and Plugins Custom Development Services

This site has long undertaken WordPress themes, plugins, WooCommerce-based store mall development business. We have 10 years of experience in WordPress development, if you want to Developing Websites with WordPress, please contact WeChat: iwillhappy1314 or email: amos@wpcio.com for inquiries.

4 thoughts on “不用插件定制修改 WordPress 角色的权限

  1. 有个疑问,如果我想让管理员下面的编辑或者作者拥有操作某个插件的权限(比如增加视频类插件),那这个权限该如何分配呢?

    1. 这个就要在插件里面单独控制了,添加插件菜单的时候:

      add_pages_page( page_title, menu_title, capability, handle, );

      把capability设置成editer或者author,然后相应的功能外边加上:

      if ( current_user_can( $capability ) ) {
        //如果有相应的权限,才允许执行这里的功能
      }

发表回复

Your email address will not be published. 必填项已用 * 标注

*