Include post_type= when redirecting after "Trash" click from item individual edit screen, to avoid going to Post edit screen for other post_types

git-svn-id: http://svn.automattic.com/wordpress/trunk@12820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2010-01-24 20:50:50 +00:00
parent 639078ecf0
commit bc62f53df4
1 changed files with 4 additions and 2 deletions

View File

@ -110,10 +110,12 @@ elseif ( isset($_POST['wp-preview']) && 'dopreview' == $_POST['wp-preview'] )
$action = 'preview'; $action = 'preview';
$sendback = wp_get_referer(); $sendback = wp_get_referer();
if ( strpos($sendback, 'post.php') !== false || strpos($sendback, 'post-new.php') !== false ) if ( strpos($sendback, 'post.php') !== false || strpos($sendback, 'post-new.php') !== false ) {
$sendback = admin_url('edit.php'); $sendback = admin_url('edit.php');
else $sendback .= ( !empty( $post_type ) ) ? '?post_type=' . $post_type : '';
} else {
$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), $sendback ); $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), $sendback );
}
switch($action) { switch($action) {
case 'postajaxpost': case 'postajaxpost':