[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/src/includes/core/ -> capabilities.php (summary)

bbPress Capabilites The functions in this file are used primarily as convenient wrappers for capability output in user profiles. This includes mapping capabilities and groups to human readable strings,

File Size: 525 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 17 functions

  bbp_get_caps_for_role()
  bbp_add_caps()
  bbp_remove_caps()
  bbp_get_blog_roles()
  bbp_add_forums_roles()
  bbp_filter_user_roles_option()
  _bbp_reinit_dynamic_roles()
  bbp_get_dynamic_roles()
  bbp_get_dynamic_role_name()
  bbp_filter_blog_editable_roles()
  bbp_get_keymaster_role()
  bbp_get_moderator_role()
  bbp_get_participant_role()
  bbp_get_spectator_role()
  bbp_get_blocked_role()
  bbp_add_roles()
  bbp_remove_roles()

Functions
Functions that are not part of a class:

bbp_get_caps_for_role( $role = '' )   X-Ref
Returns an array of capabilities based on the role that is being requested.

since: 2.0.0 bbPress (r2994)
param: string $role Optional. Defaults to The role to load caps for
return: array Capabilities for $role

bbp_add_caps()   X-Ref
Adds capabilities to WordPress user roles.

since: 2.0.0 bbPress (r2608)

bbp_remove_caps()   X-Ref
Removes capabilities from WordPress user roles.

since: 2.0.0 bbPress (r2608)

bbp_get_blog_roles()   X-Ref
Get the available roles, minus the dynamic roles that come with bbPress

since: 2.4.0 bbPress (r5064)
return: array

bbp_add_forums_roles( $wp_roles = null )   X-Ref
Add the bbPress roles to the $wp_roles global.

We do this to avoid adding these values to the database.

Note: bbPress is purposely assertive here, overwriting any keys & values
that may already exist in the $wp_roles array.

since: 2.2.0 bbPress (r4290)
param: WP_Roles $wp_roles The array of WP_Role objects that was initialized
return: WP_Roles The main $wp_roles global

bbp_filter_user_roles_option()   X-Ref
Helper function to add filter to option_wp_user_roles

since: 2.2.0 bbPress (r4363)

_bbp_reinit_dynamic_roles( $roles = array()   X-Ref
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.

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.

since: 2.2.0 bbPress (r4363)
param: array $roles
return: array Combined array of database roles and dynamic bbPress roles

bbp_get_dynamic_roles()   X-Ref
Fetch a filtered list of forum roles that the current user is
allowed to have.

Simple function who's main purpose is to allow filtering of the
list of forum roles so that plugins can remove inappropriate ones depending
on the situation or user making edits.

Specifically because without filtering, anyone with the edit_users
capability can edit others to be administrators, even if they are
only editors or authors. This filter allows admins to delegate
user management.

since: 2.2.0 bbPress (r4284)
since: 2.6.0 bbPress (r6117) Use bbpress()->roles
return: array

bbp_get_dynamic_role_name( $role_id = '' )   X-Ref
Gets a translated role name from a role ID

since: 2.3.0 bbPress (r4792)
since: 2.6.0 bbPress (r6117) Use bbp_translate_user_role()
param: string $role_id
return: string Translated role name

bbp_filter_blog_editable_roles( $all_roles = array()   X-Ref
Removes the bbPress roles from the editable roles array

This used to use array_diff_assoc() but it randomly broke before 2.2 release.
Need to research what happened, and if there's a way to speed this up.

since: 2.2.0 bbPress (r4303)
param: array $all_roles All registered roles
return: array

bbp_get_keymaster_role()   X-Ref
The keymaster role for bbPress users

since: 2.2.0 bbPress (r4284)
return: string

bbp_get_moderator_role()   X-Ref
The moderator role for bbPress users

since: 2.0.0 bbPress (r3410)
return: string

bbp_get_participant_role()   X-Ref
The participant role for registered user that can participate in forums

since: 2.0.0 bbPress (r3410)
return: string

bbp_get_spectator_role()   X-Ref
The spectator role is for registered users without any capabilities

since: 2.1.0 bbPress (r3860)
return: string

bbp_get_blocked_role()   X-Ref
The blocked role is for registered users that cannot spectate or participate

since: 2.2.0 bbPress (r4284)
return: string

bbp_add_roles()   X-Ref
Adds bbPress-specific user roles.

since: 2.0.0 bbPress (r2741)

bbp_remove_roles()   X-Ref
Removes bbPress-specific user roles from the `wp_user_roles` array.

This is currently only used when updating, uninstalling, or resetting bbPress.

since: 2.0.0 bbPress (r2741)



Generated: Mon Apr 29 01:01:00 2024 Cross-referenced by PHPXref 0.7.1