Ticket #7552: post_states.diff
File post_states.diff, 2.5 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/template.php
693 693 $posts_columns['tags'] = __('Tags'); 694 694 if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) 695 695 $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>'; 696 $posts_columns['status'] = __('Status');697 696 $posts_columns = apply_filters('manage_posts_columns', $posts_columns); 698 697 699 698 return $posts_columns; … … 1275 1274 ?> 1276 1275 <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; } ?></strong> 1277 1276 <?php 1278 if ( !empty($post->post_password) ) { _e(' — <strong>Protected</strong>'); } elseif ('private' == $post->post_status) { _e(' — <strong>Private</strong>'); } 1277 $post_states = array(); 1278 if ( !empty($post->post_password) ) 1279 $post_states[] = __('Protected'); 1280 if ( 'private' == $post->post_status ) 1281 $post_states[] = __('Private'); 1282 if ( 'draft' == $post->post_status ) 1283 $post_states[] = __('Draft'); 1284 if ( 'pending' == $post->post_status ) 1285 $post_states[] = __('Pending'); 1279 1286 1287 if ( ! empty($post_states) ) { 1288 $state_count = count($post_states); 1289 $i = 0; 1290 echo '<div id="post-states">'; 1291 foreach ( $post_states as $state ) { 1292 ++$i; 1293 ( $i == $state_count ) ? $sep = '' : $sep = ', '; 1294 echo "<span class='post-state'>$state$sep</span>"; 1295 } 1296 echo '</div>'; 1297 } 1298 1280 1299 if ( 'excerpt' == $mode ) 1281 1300 the_excerpt(); 1282 1301 … … 1357 1376 <?php 1358 1377 break; 1359 1378 1360 case 'status':1361 ?>1362 <td <?php echo $attributes ?>>1363 <a href="<?php the_permalink(); ?>" title="<?php echo attribute_escape(sprintf(__('View "%s"'), $title)); ?>" rel="permalink">1364 <?php1365 switch ( $post->post_status ) {1366 case 'publish' :1367 case 'private' :1368 _e('Published');1369 break;1370 case 'future' :1371 _e('Scheduled');1372 break;1373 case 'pending' :1374 _e('Pending Review');1375 break;1376 case 'draft' :1377 _e('Unpublished');1378 break;1379 }1380 ?>1381 </a>1382 </td>1383 <?php1384 break;1385 1386 1379 case 'control_view': 1387 1380 ?> 1388 1381 <td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></td>