current_user_can()

最后更新于:2021-11-25 22:45:03

current_user_can( string$capability, mixed$args)

响应s whether the current user has the specified capability.

参数

$capability

(string) (Required) Capability name.

$args

(mixed) (Optional) further parameters, typically starting with an object ID.

响应

(bool) Whether the current user has the given capability. If $capability is a meta cap and $object_id is passed, whether the current user has the given meta capability for the given object.

源文件

文件: gc-includes/capabilities.php

function current_user_can( $capability, ...$args ) {
	return user_can( gc_get_current_user(), $capability, ...$args );
}