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:
Ryan Boren
2011-02-09 17:30:26 +00:00
parent 4d95849968
commit 7c37c82691
4 changed files with 20 additions and 5 deletions
+4 -1
View File
@@ -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 }