WordPress.org

Make WordPress Core

Ticket #5569: edit-page-form.php.diff

File edit-page-form.php.diff, 1.7 KB (added by josephscott, 6 years ago)
  • wp-admin/edit-page-form.php

     
    6464 
    6565<fieldset class="dbx-box"> 
    6666<h3 class="dbx-handle"><?php _e('Page Status') ?></h3> 
    67 <div class="dbx-content"><?php if ( current_user_can('publish_pages') ) : ?> 
    68 <label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post->post_status, 'publish'); checked($post->post_status, 'future'); ?> /> <?php _e('Published') ?></label> 
    69 <?php endif; ?> 
    70           <label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post->post_status, 'draft'); ?> /> <?php _e('Draft') ?></label> 
    71           <label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Private') ?></label></div> 
     67<div class="dbx-content"> 
     68<?php 
     69foreach( get_page_statuses( ) as $status_value => $status_desc ) { 
     70        if( $status_value === 'publish' && !current_user_can( 'publish_pages' ) )  
     71                        continue; 
     72?> 
     73<label for="post_status_<?php echo $status_value; ?>" class="selectit"> 
     74<input id="post_status_<?php echo $status_value; ?>" name="post_status" type="radio" value="<?php echo $status_value; ?>" <?php  
     75        checked( $post->post_status, $status_value ); 
     76        // We consider 'future' to be published 
     77        if( $status_value === 'publish' ) 
     78                checked( $post->post_status, 'future' ); 
     79 ?> /> <?php _e( $status_desc ); ?> </label> 
     80<?php } ?> 
     81</div> 
    7282</fieldset> 
    7383 
    7484<fieldset id="passworddiv" class="dbx-box">