Warning: This function has been deprecated. Use bbp_switch_to_site() instead.
_bbp_reinit_dynamic_roles( array $roles = array() )
This is necessary because in a few places (noted below) WordPress initializes a blog’s roles directly from the database option. When this happens, the $wp_roles global gets flushed, causing a user to magically lose any dynamically assigned roles or capabilities when $current_user in refreshed.
Description Description
Because dynamic multiple roles is a new concept in WordPress, we work around it here for now, knowing that improvements will come to WordPress core later.
Also note that if using the $wp_user_roles global non-database approach, bbPress does not have an intercept point to add its dynamic roles.
See also See also
Parameters Parameters
- $roles
-
(Optional)
Default value: array()
Return Return
(array) Combined array of database roles and dynamic bbPress roles
Source Source
File: includes/core/capabilities.php
function _bbp_reinit_dynamic_roles( $roles = array() ) { foreach ( bbp_get_dynamic_roles() as $role_id => $details ) { $roles[ $role_id ] = $details; } return $roles; }
Changelog Changelog
Version | Description |
---|---|
2.6.0 | bbPress (r6105) |
2.2.0 | Introduced. |