Ticket #16166: 16166.diff
File 16166.diff, 4.9 KB (added by , 14 years ago) |
---|
-
wp-admin/edit-comments.php
37 37 $approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0; 38 38 39 39 $redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() ); 40 $redirect_to = add_query_arg( 'paged', $pagenum,$redirect_to );40 $redirect_to = $wp_list_table->add_query_args( $redirect_to ); 41 41 42 42 foreach ( $comment_ids as $comment_id ) { // Check the permissions on each 43 43 if ( !current_user_can( 'edit_comment', $comment_id ) ) -
wp-admin/includes/class-wp-list-table.php
614 614 $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) ); 615 615 return count( $columns ) - count( $hidden ); 616 616 } 617 618 function get_order_info() { 619 $current_orderby = isset( $_GET['orderby'] ) ? $_GET['orderby'] : ''; 617 620 621 if ( ! $current_orderby ) 622 $current_order = ''; 623 elseif ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) 624 $current_order = 'desc'; 625 else 626 $current_order = 'asc'; 627 628 return array( $current_orderby, $current_order ); 629 } 630 631 function add_query_args( $location ) { 632 $pagenum = $this->get_pagenum(); 633 list( $current_orderby, $current_order ) = $this->get_order_info(); 634 $location = add_query_arg( 'paged', $pagenum, $location ); 635 if ( $current_orderby ) 636 $location = add_query_arg( array( 'orderby' => $current_orderby, 'order' => $current_order ), $location ); 637 638 return $location; 639 } 640 618 641 /** 619 642 * Print column headers, accounting for hidden and sortable columns. 620 643 * … … 630 653 631 654 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 632 655 633 if ( isset( $_GET['orderby'] ) ) 634 $current_orderby = $_GET['orderby']; 635 else 636 $current_orderby = ''; 656 list( $current_orderby, $current_order ) = $this->get_order_info(); 637 657 638 if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )639 $current_order = 'desc';640 else641 $current_order = 'asc';642 643 658 foreach ( $columns as $column_key => $column_display_name ) { 644 659 $class = array( 'manage-column', "column-$column_key" ); 645 660 … … 733 748 * @access protected 734 749 */ 735 750 function display_tablenav( $which ) { 736 if ( 'top' == $which ) 751 if ( 'top' == $which ) { 737 752 wp_nonce_field( 'bulk-' . $this->_args['plural'] ); 753 list( $current_orderby, $current_order ) = $this->get_order_info(); 754 echo '<input type="hidden" name="orderby" value="' . esc_attr( $current_orderby ) . '" /><input type="hidden" name="order" value="' . esc_attr( $current_order ) . '" />'; 755 } 738 756 ?> 739 757 <div class="tablenav <?php echo esc_attr( $which ); ?>"> 740 758 -
wp-admin/edit-tags.php
78 78 79 79 wp_delete_term( $tag_ID, $taxonomy ); 80 80 81 $location = $wp_list_table->add_query_args( $location ); 81 82 $location = add_query_arg( 'message', 2, $location ); 82 83 wp_redirect( $location ); 83 84 exit; … … 104 105 } 105 106 106 107 $location = add_query_arg( 'message', 6, $location ); 108 $location = $wp_list_table->add_query_args( $location ); 107 109 wp_redirect( $location ); 108 110 exit; 109 111 -
wp-admin/js/list-table.dev.js
122 122 if ( 'object' != typeof response ) { 123 123 this.handle_error(); 124 124 } else { 125 var tablenav = $('.tablenav-pages'); 125 var tablenav = $('.tablenav-pages'), 126 order = $.query.GET('order'), 127 orderby = order ? $.query.GET('orderby') : ''; 126 128 127 129 this.stop_loading(); 128 130 … … 144 146 tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == $.query.GET('paged')); 145 147 tablenav.find('.next-page, .last-page').toggleClass('disabled', response.total_pages == $.query.GET('paged')); 146 148 149 $('input[name=order]').val(order); 150 $('input[name=orderby]').val(orderby); 151 147 152 $('th.column-cb :input').attr('checked', false); 148 153 149 154 if ( history.replaceState ) { -
wp-admin/edit.php
41 41 check_admin_referer('bulk-posts'); 42 42 43 43 $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() ); 44 $sendback = add_query_arg( 'paged', $pagenum,$sendback );44 $sendback = $wp_list_table->add_query_args( $sendback ); 45 45 if ( strpos($sendback, 'post.php') !== false ) 46 46 $sendback = admin_url($post_new_file); 47 47