mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-02 14:38:14 +01:00
Fix redirects for trashed post bulk ops. Props nacin, SergeyBiryukov. fixes #16355
git-svn-id: http://svn.automattic.com/wordpress/trunk@17362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b345e996c7
commit
75641ee14a
@ -35,6 +35,16 @@ foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) {
|
||||
}
|
||||
unset( $_redirect );
|
||||
|
||||
if ( 'post' != $post_type ) {
|
||||
$parent_file = "edit.php?post_type=$post_type";
|
||||
$submenu_file = "edit.php?post_type=$post_type";
|
||||
$post_new_file = "post-new.php?post_type=$post_type";
|
||||
} else {
|
||||
$parent_file = 'edit.php';
|
||||
$submenu_file = 'edit.php';
|
||||
$post_new_file = 'post-new.php';
|
||||
}
|
||||
|
||||
$doaction = $wp_list_table->current_action();
|
||||
|
||||
if ( $doaction ) {
|
||||
@ -59,7 +69,7 @@ if ( $doaction ) {
|
||||
}
|
||||
|
||||
if ( !isset( $post_ids ) ) {
|
||||
wp_redirect( admin_url("edit.php?post_type=$post_type") );
|
||||
wp_redirect( $sendback );
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -130,16 +140,6 @@ if ( $doaction ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( 'post' != $post_type ) {
|
||||
$parent_file = "edit.php?post_type=$post_type";
|
||||
$submenu_file = "edit.php?post_type=$post_type";
|
||||
$post_new_file = "post-new.php?post_type=$post_type";
|
||||
} else {
|
||||
$parent_file = 'edit.php';
|
||||
$submenu_file = 'edit.php';
|
||||
$post_new_file = 'post-new.php';
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
|
||||
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||
@ -246,6 +246,9 @@ $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated'
|
||||
|
||||
<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" />
|
||||
<input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" />
|
||||
<?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?>
|
||||
<input type="hidden" name="show_sticky" value="1" />
|
||||
<?php } ?>
|
||||
|
||||
<?php $wp_list_table->display(); ?>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user