Make WordPress Core

Changeset 16972


Ignore:
Timestamp:
12/15/2010 10:38:07 PM (15 years ago)
Author:
scribu
Message:

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

File:
1 edited

Legend:

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

    r16900 r16972  
    137137    <li>
    138138        <label><?php _e( 'Authors:' ); ?></label>
    139         <?php wp_dropdown_users( array( 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) ); ?>
     139        <select name="author" id="author">
     140        <option value="all" selected="selected"><?php _e('All'); ?></option>
     141        <?php
     142        $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>
    140149    </li>
    141150    <li>
     
    166175    <li>
    167176        <label><?php _e( 'Authors:' ); ?></label>
    168         <?php wp_dropdown_users( array( 'name' => 'page_author', 'multi' => true, 'show_option_all' => __('All') ) ); ?>
     177        <select name="author" id="author">
     178        <option value="all" selected="selected"><?php _e('All'); ?></option>
     179        <?php
     180        $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>
    169187    </li>
    170188    <li>
Note: See TracChangeset for help on using the changeset viewer.