WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/29/2008 07:22:56 PM (12 years ago)
Author:
markjaquith
Message:

More work on Publish postbox. Post status tweaks, post date tweaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r9398 r9402  
    9696    } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
    9797        $stamp = __('Publish immediately');
     98    } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
     99        $stamp = __('Schedule for:<br />%1$s');
    98100    } else { // draft, 1 or more saves, date specified
    99101        $stamp = __('Publish on:<br />%1$s');
     
    107109<?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
    108110<div class="misc-pub-section curtime">
    109     <span id="timestamp"><?php printf($stamp, $date); ?></span>
     111    <span id="timestamp">
     112    <?php printf($stamp, $date); ?></span>
    110113    &nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
    111114    <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
     
    133136?>
    134137</span></b>
    135 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?>
     138<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
    136139<a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
    137140
    138141<div id="post-status-select" class="hide-if-js">
    139142<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
    140 <br />
    141143<select name='post_status' id='post_status' tabindex='4'>
    142144<?php
    143 // only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability)
    144 if ( $can_publish OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) : ?>
     145if ( $post->post_status == 'publish' ) : ?>
    145146<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
    146147<?php if ( 'future' == $post->post_status ) : ?>
     
    151152<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
    152153</select>
    153 
     154<br />
    154155<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
    155156<a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
     
    172173<div id="minor-publishing-actions">
    173174
    174 <?php if ( 'publish' != $post->post_status && 'private' != $post->post_status )  { ?>
     175<?php if ( 'publish' != $post->post_status && 'private' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status )  { ?>
    175176<input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
     177<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
     178<input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Pending') ); ?>" tabindex="4" class="button button-highlighted" />
    176179<?php } ?>
    177180
     
    198201if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) { ?>
    199202<?php if ( current_user_can('publish_posts') ) : ?>
    200     <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
     203    <?php if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
     204        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" />
     205    <?php else : ?>
     206        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
     207    <?php endif; ?>
    201208<?php else : ?>
    202209    <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
Note: See TracChangeset for help on using the changeset viewer.