Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/19/2013 01:24:37 AM (13 years ago)
Author:
r-a-y
Message:

Only show the "Edit Member > User Capabilities" toolbar item if the
settings component is enabled.

The "User Capabilities" page requires the Settings component to be active
in order for the page to display.

Since, by default, BuddyPress does not have the Settings component active,
if a super admin attempts to click on this link, it will 404.

Adding a check for the Settings component fixes this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-adminbar.php

    r6849 r7226  
    110110
    111111    // User Admin > Spam/unspam
    112     $wp_admin_bar->add_menu( array(
    113         'parent' => $bp->user_admin_menu_id,
    114         'id'     => $bp->user_admin_menu_id . '-user-capabilities',
    115         'title'  => __( 'User Capabilities', 'buddypress' ),
    116         'href'   => bp_displayed_user_domain() . 'settings/capabilities/'
    117     ) );
     112    if ( bp_is_active( 'settings' ) ) {
     113        $wp_admin_bar->add_menu( array(
     114            'parent' => $bp->user_admin_menu_id,
     115            'id'     => $bp->user_admin_menu_id . '-user-capabilities',
     116            'title'  => __( 'User Capabilities', 'buddypress' ),
     117            'href'   => bp_displayed_user_domain() . 'settings/capabilities/'
     118        ) );
     119    }
    118120
    119121    // User Admin > Delete Account
Note: See TracChangeset for help on using the changeset viewer.