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
This commit is contained in:
Ryan Boren
2008-06-03 06:44:40 +00:00
parent 07518727b8
commit b0a0139c4d
2 changed files with 9 additions and 6 deletions
+2 -1
View File
@@ -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.