From e455106cdf432e37e2a8306b0e98f55c7bc64ae6 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 3 Jun 2008 06:44:40 +0000 Subject: [PATCH] Don't unpublish pages when a user who can edit publised pages but not publish new pages edits a page. Props jeremyclarke. see #6943 #7070 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@8034 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-page-form.php | 12 +++++++----- wp-admin/includes/post.php | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index 173d34d21..89ac2b291 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -78,14 +78,14 @@ else
-

- +

+ + post_status ) { // scheduled for publishing at a future date diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index c05ba6e1c..f98b9deec 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -63,7 +63,8 @@ function _wp_translate_postdata( $update = false ) { // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts. if ( 'page' == $_POST['post_type'] ) { if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ) ) - $_POST['post_status'] = 'pending'; + if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') ) + $_POST['post_status'] = 'pending'; } else { if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) ) : // Stop attempts to publish new posts, but allow already published posts to be saved if appropriate.