Ticket #47851: 47851.diff
File 47851.diff, 1.9 KB (added by , 4 years ago) |
---|
-
src/wp-admin/users.php
234 234 $userids = array_map( 'intval', (array) $_REQUEST['users'] ); 235 235 } 236 236 237 if ( in_array( $current_user->ID, $userids ) ) { 238 $all_userids = $userids; 239 $userids = array_diff( $userids, array( $current_user->ID ) ); 240 } 241 237 242 /** 238 243 * Filters whether the users being deleted have additional content 239 244 * associated with them outside of the `post_author` and `link_owner` relationships. … … 245 250 */ 246 251 $users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $userids ); 247 252 248 if ( ! $users_have_content ) {253 if ( $userids && ! $users_have_content ) { 249 254 if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { 250 255 $users_have_content = true; 251 256 } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { … … 271 276 </div> 272 277 <?php endif; ?> 273 278 274 <?php if ( 1 == count( $ userids ) ) : ?>279 <?php if ( 1 == count( $all_userids ) ) : ?> 275 280 <p><?php _e( 'You have specified this user for deletion:' ); ?></p> 276 281 <?php else : ?> 277 282 <p><?php _e( 'You have specified these users for deletion:' ); ?></p> … … 280 285 <ul> 281 286 <?php 282 287 $go_delete = 0; 283 foreach ( $ userids as $id ) {288 foreach ( $all_userids as $id ) { 284 289 $user = get_userdata( $id ); 285 290 if ( $id == $current_user->ID ) { 286 291 /* translators: 1: user id, 2: user login */ … … 314 319 wp_dropdown_users( 315 320 array( 316 321 'name' => 'reassign_user', 317 'exclude' => array_diff( $userids, array( $current_user->ID ) ),322 'exclude' => $userids, 318 323 'show' => 'display_name_with_login', 319 324 ) 320 325 );