Confetti Bits

cb-core-admin.php

CB Core Admin

This file will register fields for admin settings, using some of the following actions associated with BuddyBoss Platform:

  • bp_admin_setting_general_register_fields
  • bp_admin_setting_xprofile_register_fields
  • bp_admin_setting_groups_register_fields
  • bp_admin_setting_forums_register_fields
  • bp_admin_setting_activity_register_fields
  • bp_admin_setting_media_register_fields
  • bp_admin_setting_friends_register_fields
  • bp_admin_setting_invites_register_fields
  • bp_admin_setting_search_register_fields We're going to have our own little box for these settings.
Tags
since
1.0.0

Table of Contents

Classes

TeamCTG_User_Caps

Functions

cb_core_admin_setting_general_register_fields()  : mixed
CB Core Admin Settings General Register Fields
cb_core_admin_components_settings()  : mixed
cb_admin_components_options()  : mixed
cb_core_set_role_globals()  : mixed
Sets some useful globals for specialized roles for later use.
cb_core_add_admin_caps()  : mixed
Grants all capabilities to administrator users.
cb_core_current_user_can()  : bool
An alias for current_user_can()
cb_core_is_component_admin()  : bool
Checks whether a user is an admin of the given component.
cb_is_user_admin()  : bool
Checks whether user has certain administrative privileges.
cb_is_user_executive()  : mixed
Checks to see if the user is an executive user.
cb_is_user_site_admin()  : bool
Checks if the user has site admin privileges.
cb_core_admin_is_user_site_admin()  : bool
CB Core Admin Is User Site Admin
cb_core_admin_is_user_admin()  : bool
Checks whether a user has the cb_admin capability.
cb_is_user_participation_admin()  : bool
Checks to see if the user is a participation admin.
cb_is_user_requests_admin()  : bool
Checks to see if the user is a requests admin.
cb_is_user_staffing_admin()  : bool
Checks to see if the user is a staffing admin.
cb_is_user_events_admin()  : bool
Checks to see if the user is an events admin.
editor_manage_users()  : mixed
Let Editors manage users, and run this only once.
get_rid_of_the_menus()  : mixed
Remove privileged menus from the admin area.

Functions

cb_core_admin_setting_general_register_fields()

CB Core Admin Settings General Register Fields

cb_core_admin_setting_general_register_fields(mixed $setting) : mixed

Registers our settings fields in the general context of the BuddyBoss settings page environment. Key part of this is the "bp_admin_setting_{ component }_register_fields" add_section is a wordpress method to create the settings section. It requires a setting object. add_field is a wordpress method that creates a field within the section we just made. bp_admin_setting_{ component }_register_fields handles the rest.

Parameters
$setting : mixed
Tags
since
1.0.0

cb_core_admin_components_settings()

cb_core_admin_components_settings() : mixed

cb_admin_components_options()

cb_admin_components_options() : mixed

cb_core_set_role_globals()

Sets some useful globals for specialized roles for later use.

cb_core_set_role_globals() : mixed

The idea here is that once these globals are set, we can access them to grant certain permissions to certain roles, which will help us determine who can see what in our template loop.

Tags
since
3.0.0

cb_core_add_admin_caps()

Grants all capabilities to administrator users.

cb_core_add_admin_caps() : mixed
Tags
since
3.0.0

cb_core_current_user_can()

An alias for current_user_can()

cb_core_current_user_can([string $cap = '' ]) : bool
Parameters
$cap : string = ''

The capability to check for.

Tags
since
3.0.0
Return values
bool

Whether the user has the capability.

cb_core_is_component_admin()

Checks whether a user is an admin of the given component.

cb_core_is_component_admin([string $component = '' ]) : bool
Parameters
$component : string = ''

The component to check for.

Tags
since
3.0.0
Return values
bool

Whether the user is an admin for the component.

cb_is_user_admin()

Checks whether user has certain administrative privileges.

cb_is_user_admin([mixed $user_id = 0 ]) : bool

These include: - cb_participation_admin - cb_events_admin - cb_requests_admin

It's important to note that the cb_admin capability is shared by both the cb_leadership role as well as the cb_executive role, so checking for this capability will return true for both of those roles, along with users that have the 'administrator' capability.

Parameters
$user_id : mixed = 0
Tags
since
1.0.0
Return values
bool

Whether the current user is a cb_admin.

cb_is_user_executive()

Checks to see if the user is an executive user.

cb_is_user_executive() : mixed

This role carries specific, high-level privileges in certain areas of the application, so it exists as its own separate capability.

Tags
since
1.3.0

cb_is_user_site_admin()

Checks if the user has site admin privileges.

cb_is_user_site_admin([mixed $user_id = 0 ]) : bool

Checks whether a user has administrative privileges. Also, @see cb_core_admin_is_user_site_admin(), because we're deprecating this for the sake of our API and sanity (sorry besties).

Parameters
$user_id : mixed = 0
Tags
TODO:

Figure out a better dev environment setup; this isn't particularly good to use as a feature-blocker.

since
1.0.0
Return values
bool

Whether a user has administrative privileges.

cb_core_admin_is_user_site_admin()

CB Core Admin Is User Site Admin

cb_core_admin_is_user_site_admin([mixed $user_id = 0 ]) : bool

Checks whether a user has administrative privileges.

Parameters
$user_id : mixed = 0
Tags
TODO:

Figure out a better dev environment setup; this isn't particularly good to use as a feature-blocker.

since
2.3.0
Return values
bool

Whether a user has administrative privileges.

cb_core_admin_is_user_admin()

Checks whether a user has the cb_admin capability.

cb_core_admin_is_user_admin([mixed $user_id = 0 ]) : bool
Parameters
$user_id : mixed = 0
Tags
since
2.3.1
Return values
bool

Whether a user has cb_admin privileges.

cb_is_user_participation_admin()

Checks to see if the user is a participation admin.

cb_is_user_participation_admin() : bool

Checks whether a user has administrative privileges over the participation component. These privileges are granted by assigning a role on the Edit User admin page.

Tags
since
1.0.0
Return values
bool

Whether a user is a participation admin.

cb_is_user_requests_admin()

Checks to see if the user is a requests admin.

cb_is_user_requests_admin() : bool

Checks whether a user has administrative privileges over the requests component. These privileges are granted by assigning a role on the Edit User admin page.

Tags
since
3.0.0
Return values
bool

Whether a user is a requests admin.

cb_is_user_staffing_admin()

Checks to see if the user is a staffing admin.

cb_is_user_staffing_admin() : bool

Checks whether a user has administrative privileges for user moderation. These privileges are granted by assigning a role on the Edit User admin page.

Tags
since
1.0.0
Return values
bool

Whether a user is a staffing admin.

cb_is_user_events_admin()

Checks to see if the user is an events admin.

cb_is_user_events_admin() : bool

Checks whether a user has administrative privileges over the events component. These privileges are granted by assigning a role on the Edit User admin page.

Tags
since
2.3.0
Return values
bool

Whether a user is an events admin.

editor_manage_users()

Let Editors manage users, and run this only once.

editor_manage_users() : mixed

Version: 1.0.0

get_rid_of_the_menus()

Remove privileged menus from the admin area.

get_rid_of_the_menus() : mixed
Tags
since
1.2.0

        
On this page

Search results