bbp_get_user_role_map()

Return a map of WordPress roles to Forums roles. Used to automatically grant appropriate Forums roles to WordPress users that wouldn’t already have a role in the forums. Also guarantees WordPress admins get the Keymaster role.

Description

Return

(array) Filtered array of WordPress roles to Forums roles

Source

File: bp-forums/users/capabilities.php

function bbp_get_user_role_map() {

	// Get the default role once here
	$default_role = bbp_get_default_role();

	// Return filtered results, forcing admins to keymasters.
	return (array) apply_filters( 'bbp_get_user_role_map', array (
		'administrator' => bbp_get_keymaster_role(),
		'editor'        => $default_role,
		'author'        => $default_role,
		'contributor'   => $default_role,
		'subscriber'    => $default_role
	) );
}

Changelog

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