Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/06/2021 04:46:47 PM (4 years ago)
Author:
imath
Message:

BP Admin Tabs: improve the Pages settings screen display

This commit also makes sure the BP Admin Tabs are well displayed in Multisite configs when BuddyPress is network activated.

Props oztaser

Fixes #8588

File:
1 edited

Legend:

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

    r13137 r13138  
    12881288     */
    12891289    public function add_inline_styles() {
    1290         $screen                  = get_current_screen();
    1291         $current_settings_tab_id = array_search( $screen->id, $this->submenu_pages['settings'], true );
    1292         $current_tools_tab_id    = array_search( $screen->id, $this->submenu_pages['tools'], true );
     1290        $screen = get_current_screen();
     1291
     1292        if ( ! isset( $screen->id ) ) {
     1293            return;
     1294        }
     1295
     1296        // We might need to edit this id, see below code.
     1297        $screen_id = $screen->id;
     1298
     1299        // Multisite configs adds a '-network' suffix to page hooknames inside the Network Admin screens.
     1300        if ( is_multisite() && is_network_admin() && bp_is_network_activated() ) {
     1301            $screen_id = str_replace( '-network', '', $screen_id );
     1302        }
     1303
     1304        $current_settings_tab_id = array_search( $screen_id, $this->submenu_pages['settings'], true );
     1305        $current_tools_tab_id    = array_search( $screen_id, $this->submenu_pages['tools'], true );
    12931306        $current_tab_id          = '';
    12941307        $tabs                    = array();
Note: See TracChangeset for help on using the changeset viewer.