current_user_can_for_blog()
Deprecated since 6.7.0. It is no longer supported and may be removed in future releases. Use current_user_can_for_site() instead.
Returns whether the current user has the specified capability for a given site.
No Hooks.
Returns
true|false. Whether the user has the given capability.
Usage
current_user_can_for_blog( $blog_id, $capability, ...$args );
- $blog_id(int) (required)
- Site ID.
- $capability(string) (required)
- Capability name.
- ...$args(mixed) (required)
- Optional further parameters, typically starting with an object ID.
Changelog
| Since 3.0.0 | Introduced. |
| Since 5.3.0 | Formalized the existing and already documented ...$args parameter by adding it to the function signature. |
| Since 5.8.0 | Wraps current_user_can() after switching to blog. |
| Deprecated since 6.7.0 | Use current_user_can_for_site() instead. |
current_user_can_for_blog() current user can for blog code WP 6.9.1
function current_user_can_for_blog( $blog_id, $capability, ...$args ) {
return current_user_can_for_site( $blog_id, $capability, ...$args );
}