Skip to:
Content

BuddyPress.org

Changeset 13334


Ignore:
Timestamp:
10/02/2022 03:42:03 PM (2 years ago)
Author:
imath
Message:

Make sure the Available BP Tools card is only showed to Administrators

This card informs about the available BuddyPress tools into the wp-admin/tools.php page. As this page can be accessed by Contributors, Authors and Editors, we need a bp_moderate capability check before inserting this card.

Fixes #8747

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-admin.php

    r13215 r13334  
    184184        add_action( 'admin_bar_menu', array( $this, 'admin_bar_about_link' ), 100 );
    185185
    186         // Add a description of new BuddyPress tools in the available tools page.
    187         add_action( 'tool_box',            'bp_core_admin_available_tools_intro' );
    188         add_action( 'bp_network_tool_box', 'bp_core_admin_available_tools_intro' );
     186        // Add a description of BuddyPress tools in the available tools page.
     187        if ( bp_current_user_can( 'bp_moderate' ) ) {
     188            add_action( 'tool_box',            'bp_core_admin_available_tools_intro' );
     189            add_action( 'bp_network_tool_box', 'bp_core_admin_available_tools_intro' );
     190        }
    189191
    190192        // On non-multisite, catch.
Note: See TracChangeset for help on using the changeset viewer.