当TookSet Type-Access处于活动状态时,用户和用户角色未显示在WordPress中

发布于 2025-01-21 13:00:01 字数 457 浏览 5 评论 0原文

我只是在工具集的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你是暖光i 2025-01-28 13:00:01

经过许多缓存清除和瞬态删除后,我找到了解决方案,并在类型访问的代码中潜入。

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 the UserListing::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]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文