Changeset 8034

Show
Ignore:
Timestamp:
06/03/08 06:44:40 (6 months ago)
Author:
ryan
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/edit-page-form.php

    r8011 r8034  
    7979 
    8080<div class="inside"> 
    81  
    8281<p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p> 
    8382<p> 
    8483<select name='post_status' tabindex='4' id='post_status'> 
    85 <?php if ( current_user_can('publish_pages') ) : ?> 
     84<?php // Show publish in dropdown if user can publish or if they can re-publish this page ('edit_published_pages') 
     85// 'publish' option will be selected for published AND private posts (checkbox overrides dropdown) 
     86if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) :  
     87?> 
    8688<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option> 
    87 <?php else: ?> 
    88 <option<?php selected( $post->post_status, 'private' ); ?> value='private'><?php _e('Published') ?></option> 
    8989<?php endif; ?> 
    9090<?php if ( 'future' == $post->post_status ) : ?> 
     
    9595</select> 
    9696</p> 
    97  
     97<?php if ( current_user_can( 'publish_posts' ) ) : ?>  
    9898<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> 
     99<?php endif; ?> 
     100 
    99101<?php 
    100102if ($post_ID) { 
  • trunk/wp-admin/includes/post.php

    r8032 r8034  
    6464    if ( 'page' == $_POST['post_type'] ) { 
    6565        if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ) ) 
    66             $_POST['post_status'] = 'pending'; 
     66            if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') ) 
     67                $_POST['post_status'] = 'pending'; 
    6768    } else { 
    6869        if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) ) :