bp_map_meta_caps( array $caps, string $cap, int $user_id, mixed $args )

Map community caps to built in WordPress caps.

Description

See also

  • WP_User::has_cap(): for description of the arguments passed to the ‘map_meta_cap’ filter. args.

Parameters

$caps

(array) (Required) See WP_User::has_cap().

$cap

(string) (Required) See WP_User::has_cap().

$user_id

(int) (Required) See WP_User::has_cap().

$args

(mixed) (Required) See WP_User::has_cap().

Return

(array) Actual capabilities for meta capability. See WP_User::has_cap().

Source

File: bp-core/bp-core-caps.php

function bp_map_meta_caps( $caps, $cap, $user_id, $args ) {

	/**
	 * Filters the community caps mapping to be built in WordPress caps.
	 *
	 * @since BuddyPress 1.6.0
	 *
	 * @param array  $caps    Returns the user's actual capabilities.
	 * @param string $cap     Capability name.
	 * @param int    $user_id The user ID.
	 * @param array  $args    Adds the context to the cap. Typically the object ID.
	 */
	return apply_filters( 'bp_map_meta_caps', $caps, $cap, $user_id, $args );
}

Changelog

Changelog
Version Description
BuddyPress 1.6.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.