Revert to raw SQL query and HTML in export author dropdowns. Fixes #15786

git-svn-id: http://svn.automattic.com/wordpress/trunk@16972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-12-15 22:38:07 +00:00
parent 2e3644a3d7
commit 209e17506d
1 changed files with 20 additions and 2 deletions

View File

@ -136,7 +136,16 @@ function export_date_options() {
</li>
<li>
<label><?php _e( 'Authors:' ); ?></label>
<?php wp_dropdown_users( array( 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) ); ?>
<select name="author" id="author">
<option value="all" selected="selected"><?php _e('All'); ?></option>
<?php
$authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" );
$authors = $wpdb->get_results( "SELECT ID, display_name FROM $wpdb->users WHERE ID IN (" . implode( ',', $authors ) . ") ORDER BY display_name" );
foreach ( (array) $authors as $author ) {
echo "<option value='{$author->id}'>{$author->display_name}</option>\n";
}
?>
</select>
</li>
<li>
<label><?php _e( 'Date range:' ); ?></label>
@ -165,7 +174,16 @@ function export_date_options() {
<ul id="page-filters" class="export-filters">
<li>
<label><?php _e( 'Authors:' ); ?></label>
<?php wp_dropdown_users( array( 'name' => 'page_author', 'multi' => true, 'show_option_all' => __('All') ) ); ?>
<select name="author" id="author">
<option value="all" selected="selected"><?php _e('All'); ?></option>
<?php
$authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" );
$authors = $wpdb->get_results( "SELECT ID, display_name FROM $wpdb->users WHERE ID IN (" . implode( ',', $authors ) . ") ORDER BY display_name" );
foreach ( (array) $authors as $author ) {
echo "<option value='{$author->id}'>{$author->display_name}</option>\n";
}
?>
</select>
</li>
<li>
<label><?php _e( 'Date range:' ); ?></label>