BBP_Admin::map_settings_meta_caps( array $caps = array(), string $cap = '', int $user_id, mixed $args = array() )
Maps settings capabilities
Description
Parameters
- $caps
-
(Optional) Capabilities for meta capability
Default value: array()
- $cap
-
(Optional) Capability name
Default value: ''
- $user_id
-
(Required) User id
- $args
-
(Optional) Arguments
Default value: array()
Return
(array) Actual capabilities for meta capability
Source
File: bp-forums/admin/admin.php
public static function map_settings_meta_caps( $caps = array(), $cap = '', $user_id = 0, $args = array() ) { // What capability is being checked? switch ( $cap ) { // BuddyBoss case 'bbp_settings_buddypress' : if ( ( is_plugin_active( 'buddyboss-platform/bp-loader.php' ) && defined( 'BP_VERSION' ) && bp_is_root_blog() ) && is_super_admin() ) { $caps = array( bbpress()->admin->minimum_capability ); } else { $caps = array( 'do_not_allow' ); } break; // Akismet case 'bbp_settings_akismet' : if ( ( is_plugin_active( 'akismet/akismet.php' ) && defined( 'AKISMET_VERSION' ) ) && is_super_admin() ) { $caps = array( bbpress()->admin->minimum_capability ); } else { $caps = array( 'do_not_allow' ); } break; // Forums case 'bbp_about_page' : // About and Credits case 'bbp_tools_page' : // Tools Page case 'bbp_tools_repair_page' : // Tools - Repair Page case 'bbp_tools_import_page' : // Tools - Import Page case 'bbp_tools_reset_page' : // Tools - Reset Page case 'bbp_settings_page' : // Settings Page case 'bbp_settings_users' : // Settings - Users case 'bbp_settings_features' : // Settings - Features case 'bbp_settings_theme_compat' : // Settings - Theme compat case 'bbp_settings_root_slugs' : // Settings - Root slugs case 'bbp_settings_single_slugs' : // Settings - Single slugs case 'bbp_settings_user_slugs' : // Settings - User slugs case 'bbp_settings_per_page' : // Settings - Per page case 'bbp_settings_per_rss_page' : // Settings - Per RSS page $caps = array( bbpress()->admin->minimum_capability ); break; } return apply_filters( 'bbp_map_settings_meta_caps', $caps, $cap, $user_id, $args ); }
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.