Function: author_can

author_can( integer | WP_Post $post, string $capability )

Whether the author of the supplied post has a specific capability.

Parameters

Name Type(s) Default Value Description
$post integer | WP_Post

Post ID or post object.

$capability string

Capability name.

Returns

boolean

Whether the post author has the given capability.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.