функция
Устаревший since 3.0.0
current_user_can_for_blog()
Устаревшее.
Помечено устаревшим с версии 6.7.0.
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
current_user_can_for_blog( int $blog_id, string $capability, mixed $args ): bool
Описание
Возвращает, обладает ли текущий пользователь указанным правом доступа для данного сайта.
Параметры
$blog_id
int
обязательный
ID сайта.
$capability
string
обязательный
Имя права доступа.
$args
mixed
необязательный
Необязательные дополнительные параметры, обычно начинающиеся с ID объекта.
Возвращаемое значение
bool
Исходный код
wp-includes/deprecated.php:6419
function current_user_can_for_blog( $blog_id, $capability, ...$args ) {
return current_user_can_for_site( $blog_id, $capability, ...$args );
}
История изменений
| Версия | Описание |
|---|---|
| 6.7.0 | Deprecated. Use current_user_can_for_site() instead. |
| 5.8.0 | Wraps current_user_can() after switching to blog. |
| 5.3.0 | Formalized the existing and already documented ...$args parameter by adding it to the function signature. |
| 3.0.0 | Introduced. |

