get_blogs_of_user()
get_blogs_of_user( int $user_id, bool $all = false )
获取用户所属的站点。
Get the sites a user belongs to.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$user_id | (int) | 必需 | 用户ID |
$all | (bool) | 可选 | 是检索所有网站,还是仅检索未标记为已删除、存档或垃圾邮件的网站。 |
返回(Return)
(array)用户站点的列表。如果用户不存在或不属于任何站点,则为空数组。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.7.0 | wp-includes/user.php:598 | 13 | 8 |
笔记(Notes)
输出:
get_blogs_of_user() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_blogs_of_user/