diff --git wp-admin/includes/class-wp-list-table.php wp-admin/includes/class-wp-list-table.php
index 22c35f5..1e94e95 100644
|
|
class WP_List_Table { |
395 | 395 | </select> |
396 | 396 | <?php |
397 | 397 | } |
398 | | |
| 398 | /** |
| 399 | * Display a monthly dropdown for filtering items |
| 400 | * |
| 401 | * @since 3.5.3 |
| 402 | * @access protected |
| 403 | */ |
| 404 | function authors_dropdown( $post_type ) { |
| 405 | global $wpdb, $wp_locale; |
| 406 | if ( !is_multisite() || !wp_is_large_network('users')) { |
| 407 | $author_ids = $wpdb->get_results( $wpdb->prepare( " |
| 408 | SELECT DISTINCT post_author |
| 409 | FROM $wpdb->posts |
| 410 | WHERE post_type = %s |
| 411 | ORDER BY post_author DESC |
| 412 | ", $post_type ) ); |
| 413 | $author_count = count( $author_ids ); |
| 414 | if ( !$author_count || ( 1 == $author_count && 0 == $author_ids[0] ) ) |
| 415 | return; |
| 416 | $selected_author = isset( $_GET['author'] ) ? (int) $_GET['author'] : 0; |
| 417 | ?> |
| 418 | <select name='author'> |
| 419 | <option<?php selected( $selected_author, 0 ); ?> value='0'><?php _e( 'Show all authors' ); ?></option> |
| 420 | <?php |
| 421 | foreach ($author_ids as $author_id) { |
| 422 | $author = new WP_User($author_id->post_author); |
| 423 | printf( "<option %s value='%s'>%s</option>\n", |
| 424 | selected( $author->ID, $selected_author, false ), |
| 425 | esc_attr( $author->ID ), |
| 426 | /* translators: 1: month name, 2: 4-digit year */ |
| 427 | $author->display_name |
| 428 | ); |
| 429 | } |
| 430 | ?> |
| 431 | </select> |
| 432 | <?php |
| 433 | } |
| 434 | } |
399 | 435 | /** |
400 | 436 | * Display a view switcher |
401 | 437 | * |
diff --git wp-admin/includes/class-wp-posts-list-table.php wp-admin/includes/class-wp-posts-list-table.php
index a798a2c..3461a28 100644
|
|
class WP_Posts_List_Table extends WP_List_Table { |
214 | 214 | ); |
215 | 215 | wp_dropdown_categories( $dropdown_options ); |
216 | 216 | } |
| 217 | $this->authors_dropdown($this->screen->post_type); |
217 | 218 | do_action( 'restrict_manage_posts' ); |
218 | 219 | submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) ); |
219 | 220 | } |