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
This commit is contained in:
parent
3b7179f50e
commit
e455106cdf
|
@ -78,14 +78,14 @@ else
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inside">
|
<div class="inside">
|
||||||
|
|
||||||
<p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p>
|
<p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p>
|
||||||
<p>
|
<p>
|
||||||
<select name='post_status' tabindex='4' id='post_status'>
|
<select name='post_status' tabindex='4' id='post_status'>
|
||||||
<?php if ( current_user_can('publish_pages') ) : ?>
|
<?php // Show publish in dropdown if user can publish or if they can re-publish this page ('edit_published_pages')
|
||||||
|
// 'publish' option will be selected for published AND private posts (checkbox overrides dropdown)
|
||||||
|
if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) :
|
||||||
|
?>
|
||||||
<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
|
<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
|
||||||
<?php else: ?>
|
|
||||||
<option<?php selected( $post->post_status, 'private' ); ?> value='private'><?php _e('Published') ?></option>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( 'future' == $post->post_status ) : ?>
|
<?php if ( 'future' == $post->post_status ) : ?>
|
||||||
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Pending') ?></option>
|
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Pending') ?></option>
|
||||||
|
@ -94,8 +94,10 @@ else
|
||||||
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option>
|
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option>
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
|
<?php if ( current_user_can( 'publish_posts' ) ) : ?>
|
||||||
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
|
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($post_ID) {
|
if ($post_ID) {
|
||||||
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
|
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
|
||||||
|
|
|
@ -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.
|
// Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
|
||||||
if ( 'page' == $_POST['post_type'] ) {
|
if ( 'page' == $_POST['post_type'] ) {
|
||||||
if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ) )
|
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 {
|
} else {
|
||||||
if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) ) :
|
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.
|
// Stop attempts to publish new posts, but allow already published posts to be saved if appropriate.
|
||||||
|
|
Loading…
Reference in New Issue