WordPress.org

Make WordPress Core

Ticket #13944: 13944.3.patch

File 13944.3.patch, 1.2 KB (added by ocean90, 5 years ago)
  • wp-admin/plugins.php

     
    88 
    99/** WordPress Administration Bootstrap */ 
    1010require_once('./admin.php'); 
     11if ( is_multisite() ) { 
     12        $menu_perms = get_site_option( 'menu_items', array() ); 
    1113 
     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} 
     19 
    1220if ( ! current_user_can( 'activate_plugins' ) ) 
    1321        wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) ); 
    1422 
     
    315323        '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' 
    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 
    327328require_once('./admin-header.php');