WordPress.org

Make WordPress Core

Ticket #17906: 17906.2.diff

File 17906.2.diff, 6.1 KB (added by scribu, 2 years ago)
  • wp-admin/includes/meta-boxes.php

     
    1515        $post_type = $post->post_type; 
    1616        $post_type_object = get_post_type_object($post_type); 
    1717        $can_publish = current_user_can($post_type_object->cap->publish_posts); 
     18 
     19        $status_labels = array( 
     20                'private' => __( 'Privately Published' ), 
     21                'publish' => __( 'Published' ), 
     22                'future' => __( 'Scheduled' ), 
     23                'pending' => __( 'Pending Review' ), 
     24                'draft' => __( 'Draft' ), 
     25                'auto-draft' => __( 'Draft' ), 
     26        ); 
    1827?> 
    1928<div class="submitbox" id="submitpost"> 
    2029 
     
    2736 
    2837<div id="minor-publishing-actions"> 
    2938<div id="save-action"> 
    30 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> 
     39<?php if ( !in_array( $post->post_status, array( 'publish', 'future', 'pending' ) ) ) { ?> 
    3140<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" /> 
    3241<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?> 
    3342<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" /> 
    3443<?php } ?> 
    3544<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="draft-ajax-loading" alt="" /> 
    36 </div> 
     45</div><?php // #save-action ?> 
    3746 
    3847<div id="preview-action"> 
    3948<?php 
     
    5059?> 
    5160<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a> 
    5261<input type="hidden" name="wp-preview" id="wp-preview" value="" /> 
    53 </div> 
     62</div><?php // #preview-action ?> 
    5463 
    5564<div class="clear"></div> 
    56 </div><?php // /minor-publishing-actions ?> 
     65</div><?php // #minor-publishing-actions ?> 
    5766 
    5867<div id="misc-publishing-actions"> 
    5968 
    6069<div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label> 
    6170<span id="post-status-display"> 
    62 <?php 
    63 switch ( $post->post_status ) { 
    64         case 'private': 
    65                 _e('Privately Published'); 
    66                 break; 
    67         case 'publish': 
    68                 _e('Published'); 
    69                 break; 
    70         case 'future': 
    71                 _e('Scheduled'); 
    72                 break; 
    73         case 'pending': 
    74                 _e('Pending Review'); 
    75                 break; 
    76         case 'draft': 
    77         case 'auto-draft': 
    78                 _e('Draft'); 
    79                 break; 
    80 } 
    81 ?> 
     71        <?php echo $status_labels[ $post->post_status ]; ?> 
    8272</span> 
    8373<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?> 
    8474<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> 
    8575 
    8676<div id="post-status-select" class="hide-if-js"> 
    8777<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ('auto-draft' == $post->post_status ) ? 'draft' : $post->post_status); ?>" /> 
     78 
    8879<select name='post_status' id='post_status' tabindex='4'> 
    89 <?php if ( 'publish' == $post->post_status ) : ?> 
    90 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option> 
    91 <?php elseif ( 'private' == $post->post_status ) : ?> 
    92 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option> 
    93 <?php elseif ( 'future' == $post->post_status ) : ?> 
    94 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option> 
    95 <?php endif; ?> 
    96 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option> 
    97 <?php if ( 'auto-draft' == $post->post_status ) : ?> 
    98 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e('Draft') ?></option> 
    99 <?php else : ?> 
    100 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option> 
    101 <?php endif; ?> 
     80        <?php if ( in_array( $post->post_status, array( 'publish', 'private', 'future' ) ) ) : ?> 
     81        <option<?php selected( $post->post_status, 'publish' ); ?> value="<?php echo $post->post_status; ?>"><?php echo $status_labels[ $post->post_status ]; ?></option> 
     82        <?php endif; ?> 
     83 
     84        <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php echo $status_labels['pending']; ?></option> 
     85 
     86        <?php if ( 'auto-draft' == $post->post_status ) : ?> 
     87        <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php echo $status_labels['auto-draft']; ?></option> 
     88        <?php else : ?> 
     89        <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php echo $status_labels['draft']; ?></option> 
     90        <?php endif; ?> 
    10291</select> 
    10392 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a> 
    10493 <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a> 
    105 </div> 
     94</div><?php // #post-status-select ?> 
    10695 
    10796<?php } ?> 
    108 </div><?php // /misc-pub-section ?> 
     97</div><?php // .misc-pub-section ?> 
    10998 
    11099<div class="misc-pub-section " id="visibility"> 
    111100<?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php 
     
    149138 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a> 
    150139 <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a> 
    151140</p> 
    152 </div> 
     141</div><?php // #post-visibility-select ?> 
    153142<?php } ?> 
    154143 
    155 </div><?php // /misc-pub-section ?> 
     144</div><?php // .misc-pub-section ?> 
    156145 
    157146<?php 
    158147// translators: Publish box date formt, see http://php.net/date 
     
    181170        <?php printf($stamp, $date); ?></span> 
    182171        <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> 
    183172        <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div> 
    184 </div><?php // /misc-pub-section ?> 
     173</div><?php // .misc-pub-section ?> 
    185174<?php endif; ?> 
    186175 
    187176<?php do_action('post_submitbox_misc_actions'); ?>