WPDev.one
Core Function
View Source on Trac ↗

current_user_can()

current_user_can( mixed $capability, mixed $args )

Returns whether the current user has the specified capability.

Parameters 2 required

Name / Type Description
$capability
string

Capability name.

Required
mixed

...$args Optional further parameters, typically starting with an object ID.

Required

Return Value

(bool)
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.

Function Information

Since Version
2.0.0
Source File
wp-includes/capabilities.php
Advertisement