当TookSet Type-Access处于活动状态时,用户和用户角色未显示在WordPress中
我只是在工具集的 type-access 插件中发现了一种奇怪的行为。我认为这种情况与未解决的问题。 我的情况是,这是一个多站点的上下文,因此用户可以在其他网站中存在,特别是超级公式。
登录为Super-Admin,当type-access处于活动状态时,博客的用户列表为空,当我想添加新用户时,角色列表也是如此。
奇怪的是,在 cli 中(WP角色列表
,wp用户列表
) - 模式,用户和角色已很好地显示。
I just figured a strange behavior in the Toolset's Type-Access plugin. I think this si the same case as this unresolved issue.
I my case, it's a multisite context, so users can exists in others sites, specially super-admins.
Logged as super-admin, when Type-Access is active, the user-list of a blog is empty, so is the role list when I want to add a new user.
Strangely, in cli (wp role list
, wp user list
) -mode, users and roles are well shown.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过许多缓存清除和瞬态删除后,我找到了解决方案,并在类型访问的代码中潜入。
WordPress角色是通过
editable_roles
挂钩的过滤器,它依靠userListing :: get_excluded_roles
method。在Shot中,此方法返回全球角色和当前用户角色的交集。但是,如果当前的用户是 SuperAdmin ,并且没有明确的角色,则此列表为空,没有角色或用户显示。解决方案是将管理员角色手动添加到任何超级ADMIN。
WP用户SET-ROLE THE_USERNAME管理员[ - url = thesiteurl]
After many cache clear and transient deletion, I found the solution, diving in the code of Type-Access.
WordPress roles are filters via the
editable_roles
hook, which reliates to theUserListing::get_excluded_roles
method. In shot, this method return the intersection of global roles and the current user's roles. But if the current user is superadmin and do not have explicit roles, this list is empty, and no roles nor users are displayed.The solution is to manually add administrator role to any superadmin.
wp user set-role THE_USERNAME administrator [--url=thesiteurl]