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

git-svn-id: http://svn.automattic.com/wordpress/trunk@17321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-01-16 21:34:38 +00:00
parent 881e970f02
commit 94eb65baa0
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;
$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
if ( !current_user_can( 'edit_comment', $comment_id ) )

View File

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

View File

@ -41,7 +41,7 @@ if ( $doaction ) {
check_admin_referer('bulk-posts');
$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 )
$sendback = admin_url($post_new_file);

View File

@ -618,29 +618,6 @@ class WP_List_Table {
$hidden = array_intersect( array_keys( $columns ), array_filter( $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.
@ -657,7 +634,15 @@ class WP_List_Table {
$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 ) {
$class = array( 'manage-column', "column-$column_key" );
@ -752,11 +737,8 @@ class WP_List_Table {
* @access protected
*/
function display_tablenav( $which ) {
if ( 'top' == $which ) {
if ( 'top' == $which )
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 ); ?>">

View File

@ -122,9 +122,7 @@ window.listTable = {
if ( 'object' != typeof response ) {
this.handle_error();
} else {
var tablenav = $('.tablenav-pages'),
order = $.query.GET('order'),
orderby = order ? $.query.GET('orderby') : '';
var tablenav = $('.tablenav-pages');
this.stop_loading();
@ -146,9 +144,6 @@ window.listTable = {
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'));
$('input[name=order]').val(order);
$('input[name=orderby]').val(orderby);
$('th.column-cb :input').attr('checked', false);
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 = $wp_list_table->add_query_args( $location );
$location = add_query_arg( array( 'attached' => $attached ) , $location );
wp_redirect( $location );
exit;
@ -122,7 +121,6 @@ if ( $doaction ) {
break;
}
$location = $wp_list_table->add_query_args( $location );
wp_redirect( $location );
exit;
} 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_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->localize( 'list-table', 'listTableL10n', array(
'error' => __('An error has occurred while loading the items.'),