mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 21:00:21 +00:00
Add additional promote_users checks. Show Add existing button only for multisite. Don't show bulk actions if user can't promote users. Show add new user menu if user has create_users but not promote_users. Props nacin. fixes #16501 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@17431 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+4
-1
@@ -48,6 +48,9 @@ switch ( $wp_list_table->current_action() ) {
|
||||
case 'promote':
|
||||
check_admin_referer('bulk-users');
|
||||
|
||||
if ( ! current_user_can( 'promote_users' ) )
|
||||
wp_die( __( 'You can’t edit that user.' ) );
|
||||
|
||||
if ( empty($_REQUEST['users']) ) {
|
||||
wp_redirect($redirect);
|
||||
exit();
|
||||
@@ -352,7 +355,7 @@ if ( ! empty($messages) ) {
|
||||
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 } elseif ( current_user_can( 'promote_users' ) ) { ?>
|
||||
<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
|
||||
<a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
|
||||
<?php }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user