current_user_can_for_blog( int $blog_id, string $capability, mixed $args ): bool

In this article

This function has been deprecated. Use current_user_can_for_site() instead.

Returns whether the current user has the specified capability for a given site.

Parameters

$blog_idintrequired
Site ID.
$capabilitystringrequired
Capability name.
$argsmixedoptional
Optional further parameters, typically starting with an object ID.

Return

bool Whether the user has the given capability.

Source

function current_user_can_for_blog( $blog_id, $capability, ...$args ) {
	return current_user_can_for_site( $blog_id, $capability, ...$args );
}

Changelog

VersionDescription
6.7.0Use current_user_can_for_site() instead.
5.8.0Wraps current_user_can() after switching to blog.
5.3.0Formalized the existing and already documented ...$args parameter by adding it to the function signature.
3.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.