Undo for posts, pages and media, props caesarsgrunt, see #4529

git-svn-id: https://develop.svn.wordpress.org/trunk@12121 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-10-28 02:46:08 +00:00
parent 2f034b4430
commit b86ab00920
5 changed files with 23 additions and 21 deletions

View File

@@ -196,11 +196,11 @@ case 'trash':
if ( ! wp_trash_post($post_id) )
wp_die( __('Error in moving to trash...') );
$sendback = wp_get_referer();
$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
if ( strpos($sendback, 'post.php') !== false || strpos($sendback, 'post-new.php') !== false )
$sendback = admin_url('edit.php?trashed=1');
$sendback = admin_url('edit.php?trashed=1&ids='.$post_id);
else
$sendback = add_query_arg('trashed', 1, $sendback);
$sendback = add_query_arg( array('trashed' => 1, ids => $post_id), $sendback );
wp_redirect($sendback);
exit();