WordPress.org

Make WordPress Core

Changeset 15271


Ignore:
Timestamp:
06/17/2010 03:57:02 PM (8 years ago)
Author:
ryan
Message:

Allow only super admins to see plugins.php if the Plugins menu is not exposed. Props ocean90. fixes #13944

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugins.php

    r15135 r15271  
    99/** WordPress Administration Bootstrap */
    1010require_once('./admin.php');
     11if ( is_multisite() ) {
     12    $menu_perms = get_site_option( 'menu_items', array() );
     13
     14    if ( empty($menu_perms['plugins']) && ! is_super_admin() )
     15        wp_die( __( 'Cheatin’ uh?' ) );
     16    else if ( $menu_perms['plugins'] != 1 && is_super_admin() )
     17        add_action( 'admin_notices', '_admin_notice_multisite_activate_plugins_page' );
     18}
    1119
    1220if ( ! current_user_can( 'activate_plugins' ) )
     
    316324);
    317325
    318 if ( is_multisite() && is_super_admin() ) {
    319     $menu_perms = get_site_option('menu_items', array());
    320     if ( empty($menu_perms['plugins']) )
    321         add_action( 'admin_notices', '_admin_notice_multisite_activate_plugins_page' );
    322     unset($menu_perms);
    323 }
    324 
    325326$title = __('Plugins');
    326327
Note: See TracChangeset for help on using the changeset viewer.