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

Map community caps to built in WordPress caps.


Description Description

See also See also

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

Top ↑

Parameters Parameters

$caps

(Required) See WP_User::has_cap().

$cap

(Required) See WP_User::has_cap().

$user_id

(Required) See WP_User::has_cap().

$args

(Required) See WP_User::has_cap().


Top ↑

Return Return

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


Top ↑

Source 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 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 );
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.