Ticket #24869: 24869.3.diff
File 24869.3.diff, 1.7 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-posts-list-table.php
137 137 echo get_post_type_object( $this->screen->post_type )->labels->not_found; 138 138 } 139 139 140 protected function is_base_request() { 141 if ( empty( $_GET ) ) { 142 return true; 143 } elseif ( 1 === count( $_GET ) && ! empty( $_GET['post_type'] ) ) { 144 return $this->screen->post_type === $_GET['post_type']; 145 } 146 } 147 140 148 protected function get_views() { 141 149 global $locked_post_status, $avail_post_stati; 142 150 … … 165 173 foreach ( get_post_stati( array('show_in_admin_all_list' => false) ) as $state ) 166 174 $total_posts -= $num_posts->$state; 167 175 168 $class = empty( $class ) && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['show_sticky'] ) ? ' class="current"' : ''; 169 $status_links['all'] = "<a href='edit.php?post_type=$post_type{$allposts}'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>'; 176 if ( empty( $class ) && $this->is_base_request() ) { 177 $class = ' class="current"'; 178 } 170 179 180 $all_inner_html = sprintf( 181 _nx( 182 'All <span class="count">(%s)</span>', 183 'All <span class="count">(%s)</span>', 184 $total_posts, 185 'posts' 186 ), 187 number_format_i18n( $total_posts ) 188 ); 189 190 $status_links['all'] = "<a href='edit.php?post_type=$post_type{$allposts}'$class>" . $all_inner_html . '</a>'; 191 171 192 foreach ( get_post_stati(array('show_in_admin_status_list' => true), 'objects') as $status ) { 172 193 $class = ''; 173 194