Make WordPress Core


Ignore:
Timestamp:
06/30/2012 12:40:25 PM (12 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/includes/class-wp-ms-themes-list-table.php

    r21164 r21198  
    3838
    3939    function ajax_user_can() {
    40         $menu_perms = get_site_option( 'menu_items', array() );
    41 
    42         if ( empty( $menu_perms['themes'] ) && ! is_super_admin() )
    43             return false;
    44 
    45         if ( $this->is_site_themes && !current_user_can('manage_sites') )
    46             return false;
    47         elseif ( !$this->is_site_themes && !current_user_can('manage_network_themes') )
    48             return false;
    49         return true;
     40        if ( $this->is_site_themes )
     41            return current_user_can( 'manage_sites' );
     42        else
     43            return current_user_can( 'manage_network_themes' );
    5044    }
    5145
Note: See TracChangeset for help on using the changeset viewer.