Ticket #17906: 17906.2.diff
File 17906.2.diff, 6.1 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/meta-boxes.php
15 15 $post_type = $post->post_type; 16 16 $post_type_object = get_post_type_object($post_type); 17 17 $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 ); 18 27 ?> 19 28 <div class="submitbox" id="submitpost"> 20 29 … … 27 36 28 37 <div id="minor-publishing-actions"> 29 38 <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' ) ) ) { ?> 31 40 <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" /> 32 41 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?> 33 42 <input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" /> 34 43 <?php } ?> 35 44 <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 ?> 37 46 38 47 <div id="preview-action"> 39 48 <?php … … 50 59 ?> 51 60 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a> 52 61 <input type="hidden" name="wp-preview" id="wp-preview" value="" /> 53 </div> 62 </div><?php // #preview-action ?> 54 63 55 64 <div class="clear"></div> 56 </div><?php // /minor-publishing-actions ?>65 </div><?php // #minor-publishing-actions ?> 57 66 58 67 <div id="misc-publishing-actions"> 59 68 60 69 <div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label> 61 70 <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 ]; ?> 82 72 </span> 83 73 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?> 84 74 <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> 85 75 86 76 <div id="post-status-select" class="hide-if-js"> 87 77 <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 88 79 <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; ?> 102 91 </select> 103 92 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a> 104 93 <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a> 105 </div> 94 </div><?php // #post-status-select ?> 106 95 107 96 <?php } ?> 108 </div><?php // /misc-pub-section ?>97 </div><?php // .misc-pub-section ?> 109 98 110 99 <div class="misc-pub-section " id="visibility"> 111 100 <?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php … … 149 138 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a> 150 139 <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a> 151 140 </p> 152 </div> 141 </div><?php // #post-visibility-select ?> 153 142 <?php } ?> 154 143 155 </div><?php // /misc-pub-section ?>144 </div><?php // .misc-pub-section ?> 156 145 157 146 <?php 158 147 // translators: Publish box date formt, see http://php.net/date … … 181 170 <?php printf($stamp, $date); ?></span> 182 171 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> 183 172 <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 ?> 185 174 <?php endif; ?> 186 175 187 176 <?php do_action('post_submitbox_misc_actions'); ?>