diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index b93172aca3..e83ca4c9d9 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -8,6 +8,14 @@ /** WordPress Administration Bootstrap */ require_once('./admin.php'); +if ( is_multisite() ) { + $menu_perms = get_site_option( 'menu_items', array() ); + + if ( empty($menu_perms['plugins']) && ! is_super_admin() ) + wp_die( __( 'Cheatin’ uh?' ) ); + else if ( $menu_perms['plugins'] != 1 && is_super_admin() ) + add_action( 'admin_notices', '_admin_notice_multisite_activate_plugins_page' ); +} if ( ! current_user_can( 'activate_plugins' ) ) wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) ); @@ -315,13 +323,6 @@ add_contextual_help($current_screen, '

' . __('Support Forums') . '

' ); -if ( is_multisite() && is_super_admin() ) { - $menu_perms = get_site_option('menu_items', array()); - if ( empty($menu_perms['plugins']) ) - add_action( 'admin_notices', '_admin_notice_multisite_activate_plugins_page' ); - unset($menu_perms); -} - $title = __('Plugins'); require_once('./admin-header.php');