Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

map_meta_cap()

3 tags 1 category

map_meta_cap() — Maps a capability to the primitive capabilities required of the given user to satisfy the capability being checked. This function also accepts an ID of an object to map against if the capability is a meta capability. Meta capabilities such as edit_post and edit_user are capabilities used by this function to map to primitive capabilities that a user or role requires, such as edit_posts and edit_others_posts. Example usage: map_meta_cap( ‘edit_posts’, $user->ID ); map_meta_cap( ‘edit_post’, $user->ID, $post->ID ); map_meta_cap( ‘edit_post_meta’, $user->ID, $post->ID, $meta_key ); This function does not check whether the user has the required capabilities, it just returns what the required capabilities are.

Inputs: $cap (string): Capability being checked. $user_id (int): User ID.

Returns string[]: Primitive capabilities required of the user.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…