WordPress at Your Fingertips
filter is not described

map_meta_cap filter-hook . WP 2.8.0

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

Usage

add_filter( 'map_meta_cap', 'filter_function_name_2825', 10, 4 );
function filter_function_name_2825( $caps, $cap, $user_id, $args ){
	// filter...

	return $caps;
}
$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.

Changelog

Since 2.8.0 Introduced.

Where the hook is called

map_meta_cap()
map_meta_cap
wp-includes/capabilities.php 658
return apply_filters( 'map_meta_cap', $caps, $cap, $user_id, $args );

Where in WP core the hook is used WordPress

wp-includes/class-wp-customize-manager.php 2949
add_filter( 'map_meta_cap', array( $this, 'grant_edit_post_capability_for_changeset' ), 10, 4 );
wp-includes/class-wp-customize-manager.php 2956
remove_filter( 'map_meta_cap', array( $this, 'grant_edit_post_capability_for_changeset' ), 10 );