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

Maps topic tag capabilities

Description

Parameters

$caps

(Required) Capabilities for meta capability

$cap

(Required) Capability name

$user_id

(Required) User id

$args

(Required) Arguments

Return

(array) Actual capabilities for meta capability

Source

File: bp-forums/topics/capabilities.php

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

	// What capability is being checked?
	switch ( $cap ) {
		case 'manage_topic_tags'    :
		case 'edit_topic_tags'      :
		case 'delete_topic_tags'    :
		case 'assign_topic_tags'    :
		case 'bbp_topic_tags_admin' :

			// Moderators can always edit
			if ( user_can( $user_id, 'moderate' ) ) {
				$caps = array( 'moderate' );
			}
	}

	return apply_filters( 'bbp_map_topic_tag_meta_caps', $caps, $cap, $user_id, $args );
}

Changelog

Changelog
Version Description
bbPress (r4242) 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.