current_user_can_for_blog()判断当前用户角色对指定博客是否有权限(仅适用于多站点)

目录

描述

判断当前用 角色对指 博客是否有权限。这 函数仅适用于多 点multisite。

This function is similar to current_user_can(), but allows you to check if the current user has a capability for another blog on the network. To check if the user has the capability for the current blog, you can just use current_user_can().

current_user_can_for_blog() 描述

用法

<?php current_user_can_for_blog($blog_id$capability); ?>

current_user_can_for_blog() 用法

参数

$blog_id

(integer) (必填) Blog ID

默认值: None

$capability

(string) (必填) Capability or role name.

默认值: None

current_user_can_for_blog() 参数

返回值

(boolean

current_user_can_for_blog() 返回值

历史

添加于 版本: 3.0

current_user_can_for_blog() 历史

源文件

current_user_can_for_blog() 函数的代码位于 wp-includes/capabilities.php

current_user_can_for_blog() 源文件