WordPress.org

Make WordPress Core

Changeset 16975


Ignore:
Timestamp:
12/16/10 00:02:36 (4 years ago)
Author:
scribu
Message:

Use wp_dropdown_users() in export.php again, due to [16974]. See #15786

File:
1 edited

Legend:

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

    r16972 r16975  
    137137    <li> 
    138138        <label><?php _e( 'Authors:' ); ?></label> 
    139         <select name="author" id="author"> 
    140         <option value="all" selected="selected"><?php _e('All'); ?></option> 
    141         <?php 
     139<?php 
    142140        $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" ); 
    143         $authors = $wpdb->get_results( "SELECT ID, display_name FROM $wpdb->users WHERE ID IN (" . implode( ',', $authors ) . ") ORDER BY display_name" ); 
    144         foreach ( (array) $authors as $author ) { 
    145             echo "<option value='{$author->id}'>{$author->display_name}</option>\n"; 
    146         } 
    147         ?> 
    148         </select> 
     141        wp_dropdown_users( array( 'include' => $authors, 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) ); 
     142?> 
    149143    </li> 
    150144    <li> 
     
    175169    <li> 
    176170        <label><?php _e( 'Authors:' ); ?></label> 
    177         <select name="author" id="author"> 
    178         <option value="all" selected="selected"><?php _e('All'); ?></option> 
    179         <?php 
     171<?php 
    180172        $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" ); 
    181         $authors = $wpdb->get_results( "SELECT ID, display_name FROM $wpdb->users WHERE ID IN (" . implode( ',', $authors ) . ") ORDER BY display_name" ); 
    182         foreach ( (array) $authors as $author ) { 
    183             echo "<option value='{$author->id}'>{$author->display_name}</option>\n"; 
    184         } 
    185         ?> 
    186         </select> 
     173        wp_dropdown_users( array( 'include' => $authors, 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) ); 
     174?> 
    187175    </li> 
    188176    <li> 
Note: See TracChangeset for help on using the changeset viewer.