Make WordPress Core


Ignore:
Timestamp:
06/30/2012 12:40:25 PM (13 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-admin/menu.php

    r20449 r21198  
    143143}
    144144
    145 $menu_perms = get_site_option( 'menu_items', array() );
    146 if ( ! is_multisite() || is_super_admin() || ! empty( $menu_perms['plugins'] ) ) {
    147     if ( ! isset( $update_data ) )
    148         $update_data = wp_get_update_data();
    149 
    150145    $count = '';
    151     if ( ! is_multisite() && current_user_can( 'update_plugins' ) )
     146    if ( ! is_multisite() && current_user_can( 'update_plugins' ) ) {
     147        if ( ! isset( $update_data ) )
     148            $update_data = wp_get_update_data();
    152149        $count = "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n($update_data['counts']['plugins']) . "</span></span>";
     150    }
    153151
    154152    $menu[65] = array( sprintf( __('Plugins %s'), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div' );
     
    161159            $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
    162160        }
    163 }
    164 unset($menu_perms, $update_data);
     161
     162unset( $update_data );
    165163
    166164if ( current_user_can('list_users') )
Note: See TracChangeset for help on using the changeset viewer.