Make WordPress Core


Ignore:
Timestamp:
12/16/2010 11:40:46 PM (14 years ago)
Author:
scribu
Message:

Use wp_dropdown_users() in the delete confirmation screen. Props duck_. See #15854

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/users.php

    r17006 r17010  
    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>
     
    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" />
Note: See TracChangeset for help on using the changeset viewer.