diff --git wp-admin/edit-comments.php wp-admin/edit-comments.php
index 29e5f03..779c311 100644
|
|
|
if ( !current_user_can('edit_posts') ) |
| 13 | 13 | |
| 14 | 14 | $wp_list_table = get_list_table('WP_Comments_List_Table'); |
| 15 | 15 | $pagenum = $wp_list_table->get_pagenum(); |
| 16 | | |
| | 16 | list( $current_orderby, $current_order ) = $wp_list_table->get_order_info(); |
| 17 | 17 | $doaction = $wp_list_table->current_action(); |
| 18 | 18 | |
| 19 | 19 | if ( $doaction ) { |
| … |
… |
if ( $doaction ) { |
| 38 | 38 | |
| 39 | 39 | $redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() ); |
| 40 | 40 | $redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to ); |
| | 41 | if ( $current_orderby ) |
| | 42 | $redirect_to = add_query_arg( array( 'order' => $current_order, 'orderby' => $current_orderby ), $redirect_to ); |
| 41 | 43 | |
| 42 | 44 | foreach ( $comment_ids as $comment_id ) { // Check the permissions on each |
| 43 | 45 | if ( !current_user_can( 'edit_comment', $comment_id ) ) |
diff --git wp-admin/edit-tags.php wp-admin/edit-tags.php
index cfaba6c..4ca5981 100644
|
|
|
case 'bulk-delete': |
| 94 | 94 | foreach ( $tags as $tag_ID ) { |
| 95 | 95 | wp_delete_term( $tag_ID, $taxonomy ); |
| 96 | 96 | } |
| 97 | | |
| | 97 | $pagenum = $wp_list_table->get_pagenum(); |
| | 98 | list( $current_orderby, $current_order ) = $wp_list_table->get_order_info(); |
| 98 | 99 | $location = 'edit-tags.php?taxonomy=' . $taxonomy; |
| 99 | 100 | if ( 'post' != $post_type ) |
| 100 | 101 | $location .= '&post_type=' . $post_type; |
| … |
… |
case 'bulk-delete': |
| 103 | 104 | $location = $referer; |
| 104 | 105 | } |
| 105 | 106 | |
| 106 | | $location = add_query_arg( 'message', 6, $location ); |
| | 107 | $location = add_query_arg( array( 'message' => 6, 'paged' => $pagenum ), $location ); |
| | 108 | if ( $current_orderby ) |
| | 109 | $location = add_query_arg( array( 'order' => $current_order, 'orderby' => $current_orderby ), $location ); |
| | 110 | |
| 107 | 111 | wp_redirect( $location ); |
| 108 | 112 | exit; |
| 109 | 113 | |
diff --git wp-admin/edit.php wp-admin/edit.php
index 5e0154f..2cb3491 100644
|
|
|
if ( !current_user_can($post_type_object->cap->edit_posts) ) |
| 25 | 25 | |
| 26 | 26 | $wp_list_table = get_list_table('WP_Posts_List_Table'); |
| 27 | 27 | $pagenum = $wp_list_table->get_pagenum(); |
| | 28 | list( $current_orderby, $current_order ) = $wp_list_table->get_order_info(); |
| 28 | 29 | |
| 29 | 30 | // Back-compat for viewing comments of an entry |
| 30 | 31 | foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) { |
| … |
… |
if ( $doaction ) { |
| 42 | 43 | |
| 43 | 44 | $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() ); |
| 44 | 45 | $sendback = add_query_arg( 'paged', $pagenum, $sendback ); |
| | 46 | if ( $current_orderby ) |
| | 47 | $sendback = add_query_arg( array( 'order' => $current_order, 'orderby' => $current_orderby ), $sendback ); |
| 45 | 48 | if ( strpos($sendback, 'post.php') !== false ) |
| 46 | 49 | $sendback = admin_url($post_new_file); |
| 47 | 50 | |
diff --git wp-admin/includes/class-wp-list-table.php wp-admin/includes/class-wp-list-table.php
index fa2001d..d15b80b 100644
|
|
|
class WP_List_Table { |
| 611 | 611 | $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) ); |
| 612 | 612 | return count( $columns ) - count( $hidden ); |
| 613 | 613 | } |
| | 614 | |
| | 615 | function get_order_info() { |
| | 616 | if ( isset( $_GET['orderby'] ) ) |
| | 617 | $current_orderby = $_GET['orderby']; |
| | 618 | else |
| | 619 | $current_orderby = ''; |
| | 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 | } |
| 614 | 630 | |
| 615 | 631 | /** |
| 616 | 632 | * Print column headers, accounting for hidden and sortable columns. |
| … |
… |
class WP_List_Table { |
| 627 | 643 | |
| 628 | 644 | $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
| 629 | 645 | |
| 630 | | if ( isset( $_GET['orderby'] ) ) |
| 631 | | $current_orderby = $_GET['orderby']; |
| 632 | | else |
| 633 | | $current_orderby = ''; |
| 634 | | |
| 635 | | if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) |
| 636 | | $current_order = 'desc'; |
| 637 | | else |
| 638 | | $current_order = 'asc'; |
| | 646 | list( $current_orderby, $current_order ) = $this->get_order_info(); |
| 639 | 647 | |
| 640 | 648 | foreach ( $columns as $column_key => $column_display_name ) { |
| 641 | 649 | $class = array( 'manage-column', "column-$column_key" ); |
| … |
… |
class WP_List_Table { |
| 728 | 736 | * @access protected |
| 729 | 737 | */ |
| 730 | 738 | function display_tablenav( $which ) { |
| 731 | | if ( 'top' == $which ) |
| | 739 | if ( 'top' == $which ) { |
| 732 | 740 | wp_nonce_field( 'bulk-' . $this->_args['plural'] ); |
| | 741 | list( $current_orderby, $current_order ) = $this->get_order_info(); |
| | 742 | echo '<input type="hidden" name="orderby" value="' . $current_orderby . '" /><input type="hidden" name="order" value="' . $current_order . '" />'; |
| | 743 | } |
| 733 | 744 | ?> |
| 734 | 745 | <div class="tablenav <?php echo esc_attr( $which ); ?>"> |
| 735 | 746 | |
diff --git wp-admin/js/list-table.dev.js wp-admin/js/list-table.dev.js
index 51b52d1..2176da2 100644
|
|
|
window.listTable = { |
| 103 | 103 | if ( 'object' != typeof response ) { |
| 104 | 104 | this.handle_error(); |
| 105 | 105 | } else { |
| 106 | | var tablenav = $('.tablenav-pages'); |
| | 106 | var tablenav = $('.tablenav-pages'), |
| | 107 | order = $.query.GET('order'), |
| | 108 | orderby = (order) ? $.query.GET('orderby') : ''; |
| 107 | 109 | |
| 108 | 110 | this.stop_loading(); |
| 109 | 111 | |
| … |
… |
window.listTable = { |
| 124 | 126 | // Disable buttons that should noop. |
| 125 | 127 | tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == $.query.GET('paged')); |
| 126 | 128 | tablenav.find('.next-page, .last-page').toggleClass('disabled', response.total_pages == $.query.GET('paged')); |
| 127 | | |
| | 129 | |
| | 130 | $('input[name=order]').val(order); |
| | 131 | $('input[name=orderby]').val(orderby); |
| | 132 | |
| 128 | 133 | $('th.column-cb :input').attr('checked', false); |
| 129 | 134 | |
| 130 | 135 | if ( history.replaceState ) { |