Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/24/2024 08:36:35 AM (20 months ago)
Author:
imath
Message:

Administration: add a function to check a BP Admin Screen is displayed

bp_is_admin() accepts an optional parameter: a string containing the BP Admin Screen ID. If provided: it checks this screen is loaded, if not it only checks a BP Admin Screen is displayed. This function will help us put together a specific community dashboard in the future.

For now it's helping us making sure the WP Plugin dependency warning is not displayed into the WP Admin > Add new plugin > BP Add-ons tab as this tab is generated by BuddyPress: so it is available & activated!

Props emaralive.

Fixes #9212
Closes https://github.com/buddypress/buddypress/pull/334

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-admin.php

    r13937 r13974  
    180180function bp_activity_admin_load() {
    181181    global $bp_activity_list_table;
    182 
    183     $bp       = buddypress();
     182    $bp = buddypress();
     183
     184    // Traces the current BP Admin screen.
     185    $bp->admin->trace_current_screen();
     186
    184187    $doaction = bp_admin_list_table_current_bulk_action();
    185188    $min      = bp_core_get_minified_asset_suffix();
Note: See TracChangeset for help on using the changeset viewer.