current_user_can_for_blog()WP 3.0.0

Устарела с версии 6.7.0. Больше не поддерживается и может быть удалена. Используйте current_user_can_for_site().

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

Хуков нет.

Возвращает

true|false. Whether the user has the given capability.

Использование

current_user_can_for_blog( $blog_id, $capability, ...$args );
$blog_id(int) (обязательный)
Site ID.
$capability(строка) (обязательный)
Capability name.
...$args(разное) (обязательный)
Optional further parameters, typically starting with an object ID.

Список изменений

С версии 3.0.0 Введена.
С версии 5.3.0 Formalized the existing and already documented ...$args parameter by adding it to the function signature.
С версии 5.8.0 Wraps current_user_can() after switching to blog.
Устарела с 6.7.0 Use current_user_can_for_site() instead.

Код current_user_can_for_blog() WP 6.9

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