diff --git src/bp-core/bp-core-caps.php src/bp-core/bp-core-caps.php
index 7d1d00482..6f9f7984f 100644
|
|
function bp_user_can( $user_id, $capability, $args = array() ) { |
344 | 344 | return $retval; |
345 | 345 | } |
346 | 346 | |
| 347 | /** |
| 348 | * Adds the `bp_moderate` cap to the Administrator role. |
| 349 | * |
| 350 | * @since 7.0.0 |
| 351 | * |
| 352 | * @param WP_Roles $wp_roles The WordPress roles object. |
| 353 | */ |
| 354 | function _bp_roles_init( WP_Roles $wp_roles ) { |
| 355 | $wp_roles->roles[ 'administrator' ]['capabilities']['bp_moderate'] = true; |
| 356 | $wp_roles->role_objects[ 'administrator' ]->capabilities['bp_moderate'] = true; |
| 357 | } |
| 358 | add_action( 'wp_roles_init', '_bp_roles_init', 10, 1 ); |
| 359 | |
| 360 | /** Deprecated ****************************************************************/ |
| 361 | |
347 | 362 | /** |
348 | 363 | * Temporary implementation of 'bp_moderate' cap. |
349 | 364 | * |
… |
… |
function bp_user_can( $user_id, $capability, $args = array() ) { |
363 | 378 | * Plugin authors: Please do not use this function; thank you. :) |
364 | 379 | * |
365 | 380 | * @since 1.6.0 |
| 381 | * @deprecated 7.0.0 |
366 | 382 | * |
367 | 383 | * @access private |
368 | 384 | * |
… |
… |
function bp_user_can( $user_id, $capability, $args = array() ) { |
375 | 391 | * @return array $allcaps The user's cap list, with 'bp_moderate' appended, if relevant. |
376 | 392 | */ |
377 | 393 | function _bp_enforce_bp_moderate_cap_for_admins( $caps = array(), $cap = '', $user_id = 0, $args = array() ) { |
| 394 | _deprecated_function( __FUNCTION__, '7.0.0' ); |
378 | 395 | |
379 | 396 | // Bail if not checking the 'bp_moderate' cap. |
380 | 397 | if ( 'bp_moderate' !== $cap ) { |
… |
… |
function _bp_enforce_bp_moderate_cap_for_admins( $caps = array(), $cap = '', $us |
394 | 411 | // Only users that can 'manage_options' on this site can 'bp_moderate'. |
395 | 412 | return array( 'manage_options' ); |
396 | 413 | } |
397 | | add_filter( 'map_meta_cap', '_bp_enforce_bp_moderate_cap_for_admins', 10, 4 ); |
398 | | |
399 | | /** Deprecated ****************************************************************/ |
400 | 414 | |
401 | 415 | /** |
402 | 416 | * Adds BuddyPress-specific user roles. |