Skip to:
Content

BuddyPress.org

Ticket #6857: available_tools.patch

File available_tools.patch, 999 bytes (added by imath, 8 years ago)
  • src/bp-core/admin/bp-core-admin-tools.php

    diff --git src/bp-core/admin/bp-core-admin-tools.php src/bp-core/admin/bp-core-admin-tools.php
    index b8b2f3e..cab77a7 100644
    function bp_core_admin_available_tools_page() { 
    402402 * @since 2.0.0
    403403 */
    404404function bp_core_admin_available_tools_intro() {
     405        $bp_in_network_admin = bp_core_do_network_admin();
     406
     407        /**
     408         * Don't show BuddyPress tools into site administrations if BuddyPress is network activated
     409         * and multiblog is off or the current user is not an Admin of the site.
     410         */
     411        if ( ( $bp_in_network_admin && ! is_network_admin() ) || ! bp_current_user_can( 'manage_options' ) ) {
     412                return;
     413        }
     414
    405415        $query_arg = array(
    406416                'page' => 'bp-tools'
    407417        );
    408418
    409         $page = bp_core_do_network_admin() ? 'admin.php' : 'tools.php' ;
     419        $page = $bp_in_network_admin ? 'admin.php' : 'tools.php' ;
    410420        $url  = add_query_arg( $query_arg, bp_get_admin_url( $page ) );
    411421        ?>
    412422        <div class="card tool-box">