Function: author_can

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

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


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

Post ID or post object.

$capability string

Capability name.



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.