Users: On the 'Add New User' screen, don't show the roles dropdown if the current user can't promote other users.

Fixes #50345.

git-svn-id: https://develop.svn.wordpress.org/trunk@48042 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling 2020-06-14 17:01:51 +00:00
parent 5b31b4eee4
commit 90d8fdb5bb
1 changed files with 2 additions and 0 deletions

View File

@ -575,6 +575,7 @@ if ( current_user_can( 'create_users' ) ) {
</td> </td>
</tr> </tr>
<?php } // End if ! is_multisite(). ?> <?php } // End if ! is_multisite(). ?>
<?php if ( current_user_can( 'promote_users' ) ) { ?>
<tr class="form-field"> <tr class="form-field">
<th scope="row"><label for="role"><?php _e( 'Role' ); ?></label></th> <th scope="row"><label for="role"><?php _e( 'Role' ); ?></label></th>
<td><select name="role" id="role"> <td><select name="role" id="role">
@ -587,6 +588,7 @@ if ( current_user_can( 'create_users' ) ) {
</select> </select>
</td> </td>
</tr> </tr>
<?php } ?>
<?php if ( is_multisite() && current_user_can( 'manage_network_users' ) ) { ?> <?php if ( is_multisite() && current_user_can( 'manage_network_users' ) ) { ?>
<tr> <tr>
<th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th> <th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th>