From 01429c0362715d30c001bd1ee884b6e0af292e61 Mon Sep 17 00:00:00 2001 From: nacin Date: Sun, 14 Feb 2010 13:17:31 +0000 Subject: [PATCH] Improve updated messages in Media Library. Add plural strings, add Undo links for trash. Fixes #11402 git-svn-id: http://svn.automattic.com/wordpress/trunk@13153 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/upload.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/wp-admin/upload.php b/wp-admin/upload.php index 94f9c9dcd..d6222a578 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -90,7 +90,7 @@ if ( isset($_GET['find_detached']) ) { if ( !wp_trash_post($post_id) ) wp_die( __('Error in moving to trash...') ); } - $location = add_query_arg( array( 'message' => 4, 'ids' => join(',', $post_ids) ), $location ); + $location = add_query_arg( array( 'trashed' => count($post_ids), 'ids' => join(',', $post_ids) ), $location ); break; case 'untrash': foreach( (array) $post_ids as $post_id ) { @@ -100,7 +100,7 @@ if ( isset($_GET['find_detached']) ) { if ( !wp_untrash_post($post_id) ) wp_die( __('Error in restoring from trash...') ); } - $location = add_query_arg('message', 5, $location); + $location = add_query_arg('untrashed', count($post_ids), $location); break; case 'delete': foreach( (array) $post_ids as $post_id_del ) { @@ -110,7 +110,7 @@ if ( isset($_GET['find_detached']) ) { if ( !wp_delete_attachment($post_id_del) ) wp_die( __('Error in deleting...') ); } - $location = add_query_arg('message', 2, $location); + $location = add_query_arg('deleted', count($post_ids), $location); break; } @@ -175,28 +175,29 @@ if ( isset($_GET['s']) && $_GET['s'] ) ' . __('Undo') . ''; $_SERVER['REQUEST_URI'] = remove_query_arg(array('trashed'), $_SERVER['REQUEST_URI']); } if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) { - $_GET['message'] = '5'; + $message = sprintf( _n( 'Media attachment restored from the trash.', '%d media attachments restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) ); $_SERVER['REQUEST_URI'] = remove_query_arg(array('untrashed'), $_SERVER['REQUEST_URI']); }