Make WordPress Core

Ticket #39082: 39082-partial-1.patch

File 39082-partial-1.patch, 1.7 KB (added by achbed, 7 years ago)
  • wp-admin/network/menu.php

     
    2727$menu[5] = array(__('Sites'), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'dashicons-admin-multisite');
    2828$submenu['sites.php'][5]  = array( __('All Sites'), 'manage_sites', 'sites.php' );
    2929$submenu['sites.php'][10]  = array( _x('Add New', 'site'), 'create_sites', 'site-new.php' );
     30if ( ! current_user_can( 'manage_sites' ) && current_user_can( 'create_sites' ) ) {
     31        $menu[5][2] = 'site-new.php';
     32        $submenu['site-new.php'][10]  = $submenu['sites.php'][10];
     33        unset( $submenu['sites.php'] );
     34}
    3035
    3136$menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users');
    3237$submenu['users.php'][5]  = array( __('All Users'), 'manage_network_users', 'users.php' );
    3338$submenu['users.php'][10]  = array( _x('Add New', 'user'), 'create_users', 'user-new.php' );
     39if ( ! current_user_can( 'manage_network_users' ) && current_user_can( 'create_users' ) ) {
     40        $menu[10][2] = 'user-new.php';
     41        $submenu['user-new.php'][10]  = $submenu['users.php'][10];
     42        unset( $submenu['users.php'] );
     43}
    3444
    3545if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
    3646        $menu[15] = array(sprintf( __( 'Themes %s' ), "<span class='update-plugins count-{$update_data['counts']['themes']}'><span class='theme-count'>" . number_format_i18n( $update_data['counts']['themes'] ) . "</span></span>" ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );