WordPress.org

Make WordPress Core

Ticket #15854: wp-admin.users.php.diff

File wp-admin.users.php.diff, 1.3 KB (added by duck_, 7 years ago)
  • wp-admin/users.php

     
    172172                        $go_delete = true;
    173173                }
    174174        }
    175         $all_logins = get_users();
    176         $user_dropdown = '<select name="reassign_user">';
    177         foreach ( (array) $all_logins as $login )
    178                 if ( $login->ID == $current_user->ID || !in_array($login->ID, $userids) )
    179                         $user_dropdown .= "<option value=\"" . esc_attr($login->ID) . "\">{$login->user_login}</option>";
    180         $user_dropdown .= '</select>';
    181175        ?>
    182176        </ul>
    183177<?php if ( $go_delete ) : ?>
     
    186180                <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" checked="checked" />
    187181                <?php _e('Delete all posts and links.'); ?></label></li>
    188182                <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" />
    189                 <?php echo '<label for="delete_option1">'.__('Attribute all posts and links to:')."</label> $user_dropdown"; ?></li>
     183                <?php echo '<label for="delete_option1">'.__('Attribute all posts and links to:').'</label>';
     184                wp_dropdown_users( array( 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li>
    190185        </ul></fieldset>
    191186        <input type="hidden" name="action" value="dodelete" />
    192187        <?php submit_button( __('Confirm Deletion'), 'secondary' ); ?>