From b0a0139c4dd43f5d8f320d7ea3d3e9461845519d Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@8034 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 173d34d213..89ac2b2911 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 c05ba6e1c0..f98b9deece 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.