From 3f5a70545dadb2ae21110716ed06d87f7399e59b Mon Sep 17 00:00:00 2001
From: azaozz
Date: Tue, 11 Nov 2008 11:34:08 +0000
Subject: [PATCH] Add check for bulk-edit when deleting posts/pages, see #8135
git-svn-id: http://svn.automattic.com/wordpress/trunk@9607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-admin/css/colors-fresh.css | 17 ++++++++++-------
wp-admin/edit-pages.php | 9 ++++++---
wp-admin/edit.php | 8 +++++---
wp-admin/includes/template.php | 4 +++-
wp-admin/js/inline-edit-post.js | 5 -----
5 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/wp-admin/css/colors-fresh.css b/wp-admin/css/colors-fresh.css
index 1035e881af..97ed961799 100644
--- a/wp-admin/css/colors-fresh.css
+++ b/wp-admin/css/colors-fresh.css
@@ -278,19 +278,21 @@ ul#widget-list li.widget-list-item h4.widget-title {
text-shadow: #FFF 0 1px 0;
}
-.button-secondary {
- border-color: #CFE1EF;
- color: #464646;
- text-shadow: #FFF, 0 1px 0;
-}
-
.button,
.submit input,
.button-secondary {
background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
}
-.button-primary {
+.button-secondary,
+.submit .button-secondary {
+ border-color: #CFE1EF;
+ color: #464646;
+ text-shadow: #FFF, 0 1px 0;
+}
+
+.button-primary,
+.submit .button-primary {
border-color: #21759B;
color: #FFF;
background: #21759B url(../images/button-grad.png) repeat-x scroll left top;
@@ -299,6 +301,7 @@ ul#widget-list li.widget-list-item h4.widget-title {
.button[disabled],
.button:disabled {
background-color: #999;
+ background-image: none;
}
.button:hover,
diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php
index 5a3f8a8cdd..b60740d7c2 100644
--- a/wp-admin/edit-pages.php
+++ b/wp-admin/edit-pages.php
@@ -15,7 +15,7 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
switch ( $doaction ) {
case 'delete':
- if ( isset($_GET['post']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
+ if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
check_admin_referer('bulk-pages');
foreach( (array) $_GET['post'] as $post_id_del ) {
$post_del = & get_post($post_id_del);
@@ -34,7 +34,7 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
}
break;
case 'edit':
- if ( isset($_GET['post']) ) {
+ if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
check_admin_referer('bulk-pages');
if ( -1 == $_GET['_status'] ) {
@@ -48,6 +48,7 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
}
break;
}
+
$sendback = wp_get_referer();
if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php');
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
@@ -120,7 +121,9 @@ if ( (int) $_GET['skipped'] ) {
if ( (int) $_GET['locked'] ) {
printf( __ngettext( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
unset($_GET['locked']);
-} ?>
+}
+$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated'), $_SERVER['REQUEST_URI'] );
+?>
diff --git a/wp-admin/edit.php b/wp-admin/edit.php
index afa3259a4f..5ebe980af2 100644
--- a/wp-admin/edit.php
+++ b/wp-admin/edit.php
@@ -15,7 +15,7 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
switch ( $doaction ) {
case 'delete':
- if ( isset($_GET['post']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
+ if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
check_admin_referer('bulk-posts');
foreach( (array) $_GET['post'] as $post_id_del ) {
$post_del = & get_post($post_id_del);
@@ -34,7 +34,7 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
}
break;
case 'edit':
- if ( isset($_GET['post']) ) {
+ if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
check_admin_referer('bulk-posts');
if ( -1 == $_GET['_status'] ) {
@@ -114,7 +114,9 @@ if ( (int) $_GET['skipped'] )
if ( (int) $_GET['locked'] ) {
printf( __ngettext( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
unset($_GET['locked']);
-} ?>
+}
+$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated'), $_SERVER['REQUEST_URI'] );
+?>
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 4091224513..f6aaa0a354 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -1121,10 +1121,12 @@ function inline_edit_row( $type ) {
?>
-
+
+
+
diff --git a/wp-admin/js/inline-edit-post.js b/wp-admin/js/inline-edit-post.js
index 9fd45dd985..e6a4e71b18 100644
--- a/wp-admin/js/inline-edit-post.js
+++ b/wp-admin/js/inline-edit-post.js
@@ -23,7 +23,6 @@ inlineEditPost = {
$('input, select', qeRow).keydown(function(e) { if(e.which == 13) return inlineEditPost.save(this); });
$('a.cancel', bulkRow).click(function() { return inlineEditPost.revert(); });
- $('a.save', bulkRow).click(function() { return inlineEditPost.saveBulk(); });
// add events
// t.rows.dblclick(function() { inlineEditPost.toggle(this); });
@@ -227,10 +226,6 @@ inlineEditPost = {
return false;
},
- saveBulk : function() {
- $('form#posts-filter').submit();
- },
-
revert : function() {
var id;