From 0d3ce58ccbdccd5a953ae7c0e78e1b656f0c848c Mon Sep 17 00:00:00 2001 From: azaozz Date: Thu, 6 Aug 2009 00:40:39 +0000 Subject: [PATCH] Notice fixes, props mrmist, see #4529 git-svn-id: http://svn.automattic.com/wordpress/trunk@11779 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-comments.php | 2 +- wp-admin/edit-pages.php | 12 +++++++----- wp-admin/edit.php | 18 ++++++++++-------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index ca073a374..8aa3693ea 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -132,7 +132,7 @@ if ( isset($_GET['approved']) || isset($_GET['deleted']) || isset($_GET['trashed echo '
'; } if ( $untrashed > 0 ) { - printf( _n( '%s comment removed from the trash', '%s comments removed from the trash', $untrashed ), $untrashed ); + printf( _n( '%s comment restored from the trash', '%s comments restored from the trash', $untrashed ), $untrashed ); echo '
'; } if ( $deleted > 0 ) { diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php index 032636fb9..9933dd42f 100644 --- a/wp-admin/edit-pages.php +++ b/wp-admin/edit-pages.php @@ -168,7 +168,7 @@ if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) { unset($_GET['trashed']); } if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) { - printf( _n( 'Page removed from the trash.', '%s pages removed from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) ); + printf( _n( 'Page restored from the trash.', '%s pages restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) ); unset($_GET['untrashed']); } $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] ); @@ -239,6 +239,8 @@ $page_links = paginate_links( array( 'current' => $pagenum )); +$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash'; + if ( $page_links ) : ?>
' . __( 'Displaying %s–%s of %s' ) . '%s', number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ), @@ -251,7 +253,7 @@ if ( $page_links ) : ?>
- +
@@ -298,7 +300,7 @@ if ( $page_links )
- +
diff --git a/wp-admin/edit.php b/wp-admin/edit.php index d8239c9bf..b0227d7db 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -24,7 +24,7 @@ if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['pag if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { check_admin_referer('bulk-posts'); - if (isset($_GET['delete_all']) || isset($_GET['delete_all2'])) { + if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { $post_status = $wpdb->escape($_GET['post_status']); $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='post' AND post_status = '$post_status'" ); $doaction = 'delete'; @@ -166,15 +166,15 @@ if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) { if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) { printf( _n( 'Post moved to the trash.', '%s posts moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) ); - unset($_GET['deleted']); + unset($_GET['trashed']); } if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) { - printf( _n( 'Post removed from the trash.', '%s posts removed from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) ); + printf( _n( 'Post restored from the trash.', '%s posts restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) ); unset($_GET['undeleted']); } -$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] ); +$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] ); ?>

@@ -232,12 +232,14 @@ $page_links = paginate_links( array( 'current' => $_GET['paged'] )); +$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash'; + ?>
+if ( $is_trash && current_user_can('edit_others_posts') ) { ?>
@@ -325,7 +327,7 @@ if ( $page_links )
- +