WordPress 如何列出具有特定功能的用户 [英] How WordPress can list users with specific capabilities

查看:26
本文介绍了WordPress 如何列出具有特定功能的用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法只列出具有特定功能的用户,比如我们publish_posts"?

Is there a way to list only the users that has a specific capability, such us "publish_posts" ?

推荐答案

您可以使用 WP_User_Query,但是 afaik 你只能返回不同的角色,不能返回权限,也许这已经是你想要的了!还有一个网站,您可以在其中查看 wordpress 文档中不同的角色.

You can list users with WP_User_Query, but afaik you can only return different roles, not permissions, maybe that's already what you want! There's also a site where you can see the different roles in the wordpress documentation.

这篇关于WordPress 如何列出具有特定功能的用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆