Make WordPress Core


Ignore:
Timestamp:
06/30/2012 12:40:25 PM (14 years ago)
Author:
nacin
Message:

Enforce multisite plugins menu preference in map_meta_cap(). This means a simple current_user_can('activate_plugins') check will handle the 'Enable administration menus' setting.

Remove bogus checks for enabling/disabling the 'themes' menu (something core does not handle out of the box) when in the network admin.

fixes #21123.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r21152 r21198  
    11651165                        $caps[] = $cap;
    11661166                break;
     1167        case 'activate_plugins':
     1168                $caps[] = $cap;
     1169                if ( is_multisite() ) {
     1170                        // update_, install_, and delete_ are handled above with is_super_admin().
     1171                        $menu_perms = get_site_option( 'menu_items', array() );
     1172                        if ( empty( $menu_perms['plugins'] ) )
     1173                                $caps[] = 'manage_network_plugins';
     1174                }
     1175                break;
    11671176        case 'delete_user':
    11681177        case 'delete_users':
Note: See TracChangeset for help on using the changeset viewer.