map_meta_cap WordPress Filter Hook

map_meta_cap is a Wordpress hook that allows you to map meta capabilities to primitive capabilities. This can be useful for customizing the capabilities of a user role.

apply_filters( 'map_meta_cap', string[] $caps, string $cap, int $user_id, array $args ) #

Filters the primitive capabilities required of the given user to satisfy the capability being checked.


Parameters

$caps

(string[])Primitive capabilities required of the user.

$cap

(string)Capability being checked.

$user_id

(int)The user ID.

$args

(array)Adds context to the capability check, typically starting with an object ID.


Top ↑

Source

File: wp-includes/capabilities.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.