Function: current_user_can_for_blog

current_user_can_for_blog( integer $blog_id, string $capability )

Whether the current user has a specific capability for a given site.

Parameters

Name Type(s) Default Value Description
$blog_id integer

Site ID.

$capability string

Capability name.

Returns

boolean

Whether the user has the given capability.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.