Revert [17270], [17273], see #16166, see #16262.

git-svn-id: https://develop.svn.wordpress.org/trunk@17321 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2011-01-16 21:34:38 +00:00
parent e6f68ba5f6
commit 71b24d4577
8 changed files with 15 additions and 42 deletions

View File

@ -37,7 +37,7 @@ if ( $doaction ) {
$approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0; $approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0;
$redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() ); $redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() );
$redirect_to = $wp_list_table->add_query_args( $redirect_to ); $redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to );
foreach ( $comment_ids as $comment_id ) { // Check the permissions on each foreach ( $comment_ids as $comment_id ) { // Check the permissions on each
if ( !current_user_can( 'edit_comment', $comment_id ) ) if ( !current_user_can( 'edit_comment', $comment_id ) )

View File

@ -78,7 +78,6 @@ case 'delete':
wp_delete_term( $tag_ID, $taxonomy ); wp_delete_term( $tag_ID, $taxonomy );
$location = $wp_list_table->add_query_args( $location );
$location = add_query_arg( 'message', 2, $location ); $location = add_query_arg( 'message', 2, $location );
wp_redirect( $location ); wp_redirect( $location );
exit; exit;
@ -105,7 +104,6 @@ case 'bulk-delete':
} }
$location = add_query_arg( 'message', 6, $location ); $location = add_query_arg( 'message', 6, $location );
$location = $wp_list_table->add_query_args( $location );
wp_redirect( $location ); wp_redirect( $location );
exit; exit;

View File

@ -41,7 +41,7 @@ if ( $doaction ) {
check_admin_referer('bulk-posts'); check_admin_referer('bulk-posts');
$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() ); $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
$sendback = $wp_list_table->add_query_args( $sendback ); $sendback = add_query_arg( 'paged', $pagenum, $sendback );
if ( strpos($sendback, 'post.php') !== false ) if ( strpos($sendback, 'post.php') !== false )
$sendback = admin_url($post_new_file); $sendback = admin_url($post_new_file);

View File

@ -619,29 +619,6 @@ class WP_List_Table {
return count( $columns ) - count( $hidden ); return count( $columns ) - count( $hidden );
} }
function get_order_info() {
$current_orderby = isset( $_GET['orderby'] ) ? $_GET['orderby'] : '';
if ( ! $current_orderby )
$current_order = '';
elseif ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )
$current_order = 'desc';
else
$current_order = 'asc';
return array( $current_orderby, $current_order );
}
function add_query_args( $location ) {
$pagenum = $this->get_pagenum();
list( $current_orderby, $current_order ) = $this->get_order_info();
$location = add_query_arg( 'paged', $pagenum, $location );
if ( $current_orderby )
$location = add_query_arg( array( 'orderby' => $current_orderby, 'order' => $current_order ), $location );
return $location;
}
/** /**
* Print column headers, accounting for hidden and sortable columns. * Print column headers, accounting for hidden and sortable columns.
* *
@ -657,7 +634,15 @@ class WP_List_Table {
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
list( $current_orderby, $current_order ) = $this->get_order_info(); if ( isset( $_GET['orderby'] ) )
$current_orderby = $_GET['orderby'];
else
$current_orderby = '';
if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )
$current_order = 'desc';
else
$current_order = 'asc';
foreach ( $columns as $column_key => $column_display_name ) { foreach ( $columns as $column_key => $column_display_name ) {
$class = array( 'manage-column', "column-$column_key" ); $class = array( 'manage-column', "column-$column_key" );
@ -752,11 +737,8 @@ class WP_List_Table {
* @access protected * @access protected
*/ */
function display_tablenav( $which ) { function display_tablenav( $which ) {
if ( 'top' == $which ) { if ( 'top' == $which )
wp_nonce_field( 'bulk-' . $this->_args['plural'] ); wp_nonce_field( 'bulk-' . $this->_args['plural'] );
list( $current_orderby, $current_order ) = $this->get_order_info();
echo '<input type="hidden" name="orderby" value="' . esc_attr( $current_orderby ) . '" /><input type="hidden" name="order" value="' . esc_attr( $current_order ) . '" />';
}
?> ?>
<div class="tablenav <?php echo esc_attr( $which ); ?>"> <div class="tablenav <?php echo esc_attr( $which ); ?>">

View File

@ -122,9 +122,7 @@ window.listTable = {
if ( 'object' != typeof response ) { if ( 'object' != typeof response ) {
this.handle_error(); this.handle_error();
} else { } else {
var tablenav = $('.tablenav-pages'), var tablenav = $('.tablenav-pages');
order = $.query.GET('order'),
orderby = order ? $.query.GET('orderby') : '';
this.stop_loading(); this.stop_loading();
@ -146,9 +144,6 @@ window.listTable = {
tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == $.query.GET('paged')); tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == $.query.GET('paged'));
tablenav.find('.next-page, .last-page').toggleClass('disabled', response.total_pages == $.query.GET('paged')); tablenav.find('.next-page, .last-page').toggleClass('disabled', response.total_pages == $.query.GET('paged'));
$('input[name=order]').val(order);
$('input[name=orderby]').val(orderby);
$('th.column-cb :input').attr('checked', false); $('th.column-cb :input').attr('checked', false);
if ( history.replaceState ) { if ( history.replaceState ) {

File diff suppressed because one or more lines are too long

View File

@ -84,7 +84,6 @@ if ( $doaction ) {
$location = $referer; $location = $referer;
} }
$location = $wp_list_table->add_query_args( $location );
$location = add_query_arg( array( 'attached' => $attached ) , $location ); $location = add_query_arg( array( 'attached' => $attached ) , $location );
wp_redirect( $location ); wp_redirect( $location );
exit; exit;
@ -122,7 +121,6 @@ if ( $doaction ) {
break; break;
} }
$location = $wp_list_table->add_query_args( $location );
wp_redirect( $location ); wp_redirect( $location );
exit; exit;
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {

View File

@ -299,7 +299,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' ); $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' );
$scripts->add_data( 'admin-custom-fields', 'group', 1 ); $scripts->add_data( 'admin-custom-fields', 'group', 1 );
$scripts->add( 'list-table', "/wp-admin/js/list-table$suffix.js", array( 'jquery-query', 'jquery-serialize-object' ), '20110112' ); $scripts->add( 'list-table', "/wp-admin/js/list-table$suffix.js", array( 'jquery-query', 'jquery-serialize-object' ), '20110111a' );
$scripts->add_data( 'list-table', 'group', 1 ); $scripts->add_data( 'list-table', 'group', 1 );
$scripts->localize( 'list-table', 'listTableL10n', array( $scripts->localize( 'list-table', 'listTableL10n', array(
'error' => __('An error has occurred while loading the items.'), 'error' => __('An error has occurred while loading the items.'),