WordPress.org

Make WordPress Core

Ticket #12098: 12098.diff

File 12098.diff, 1.6 KB (added by nacin, 4 years ago)
  • wp-admin/menu.php

     
    128128if ( current_user_can('edit_users') ) { 
    129129        $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php. 
    130130        $submenu['users.php'][5] = array(__('Authors & Users'), 'edit_users', 'users.php'); 
    131  
    132         if ( ! is_multisite() || get_site_option( 'add_new_users' ) ) 
    133                 $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php'); 
    134  
     131        $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php'); 
    135132        $submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php'); 
    136133} else { 
    137134        $_wp_real_parent_file['users.php'] = 'profile.php'; 
  • wp-admin/users.php

     
    254254 
    255255<div class="wrap"> 
    256256<?php screen_icon(); ?> 
    257 <h2><?php echo esc_html( $title ); if ( !is_multisite() || get_site_option( 'add_new_users' ) ) { ?>  <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'user'); ?></a><?php } 
     257<h2><?php echo esc_html( $title ); if ( current_user_can( 'create_users' ) ) { ?>  <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'user'); ?></a><?php } 
    258258if ( isset($_GET['usersearch']) && $_GET['usersearch'] ) 
    259259        printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $_GET['usersearch'] ) ); ?> 
    260260</h2>