Ticket #34577: 34577.patch
| File 34577.patch, 2.3 KB (added by , 10 years ago) |
|---|
-
src/wp-admin/includes/class-wp-posts-list-table.php
78 78 * @param array $args An associative array of arguments. 79 79 */ 80 80 public function __construct( $args = array() ) { 81 global $post_type_object, $wpdb ;81 global $post_type_object, $wpdb, $mode; 82 82 83 83 parent::__construct( array( 84 84 'plural' => 'posts', … … 88 88 $post_type = $this->screen->post_type; 89 89 $post_type_object = get_post_type_object( $post_type ); 90 90 91 if ( ! empty( $_REQUEST['mode'] ) ) { 92 $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list'; 93 set_user_setting ( 'posts_list_mode', $mode ); 94 } else { 95 $mode = get_user_setting ( 'posts_list_mode', 'list' ); 96 } 97 91 98 $exclude_states = get_post_stati( array( 92 99 'show_in_admin_all_list' => false, 93 100 ) ); … … 157 164 * @global array $avail_post_stati 158 165 * @global WP_Query $wp_query 159 166 * @global int $per_page 160 * @global string $mode161 167 */ 162 168 public function prepare_items() { 163 global $avail_post_stati, $wp_query, $per_page , $mode;169 global $avail_post_stati, $wp_query, $per_page; 164 170 165 171 // is going to call wp() 166 172 $avail_post_stati = wp_edit_posts_query(); … … 196 202 197 203 $total_pages = ceil( $total_items / $per_page ); 198 204 199 if ( ! empty( $_REQUEST['mode'] ) ) {200 $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';201 set_user_setting ( 'posts_list_mode', $mode );202 } else {203 $mode = get_user_setting ( 'posts_list_mode', 'list' );204 }205 206 205 $this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] === 'trash'; 207 206 208 207 $this->set_pagination_args( array( … … 490 489 * list table. 491 490 * 492 491 * @since 4.4.0 493 * 492 * 494 493 * @param string $which The location of the extra table nav markup: 'top' or 'bottom'. 495 494 */ 496 495 do_action( 'manage_posts_extra_tablenav', $which ); … … 647 646 } 648 647 649 648 /** 650 * @global string $mode651 649 * @param array $posts 652 650 * @param int $level 653 651 */ 654 652 private function _display_rows( $posts, $level = 0 ) { 655 global $mode;656 657 653 // Create array of post IDs. 658 654 $post_ids = array(); 659 655