Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/map meta cap


Map meta capabilities to primitive capabilities.

This does not actually compare whether the user ID has the actual capability, just what the capability or capabilities are. Meta capability list value can be one of the following:

  • 'delete_page'
  • 'delete_post'
  • 'delete_user'
  • 'edit_comment' (3.1. Mapped to 'edit_post' meta capability.)
  • 'edit_page'
  • 'edit_post'
  • 'edit_user'
  • 'publish_post' (3.5)
  • 'promote_user'
  • 'read_post'
  • 'read_page'
  • 'remove_user'


(string) (required) Capability name.
Default: None
(integer) (required) User ID.
Default: None

Return Values

Actual capabilities for meta capability.

Change Log

  • 3.5.0: Add 'publish_post' meta cap
  • Since: 2.0

Source File

map_meta_cap() is located in wp-includes/capabilities.php