Ordering and labeling niceties for the Manage > Posts screen. see #4446

git-svn-id: http://svn.automattic.com/wordpress/trunk@5751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2007-06-24 06:25:49 +00:00
parent d50996b941
commit 1111b0c5fe
2 changed files with 22 additions and 3 deletions

View File

@ -29,7 +29,11 @@ foreach($posts_columns as $column_name=>$column_display_name) {
<th scope="row" style="text-align: center"><?php echo $id ?></th>
<?php
break;
case 'modified':
?>
<td><?php if ( '0000-00-00 00:00:00' ==$post->post_modified ) _e('Never'); else the_modified_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?></td>
<?php
break;
case 'date':
?>
<td><?php if ( '0000-00-00 00:00:00' ==$post->post_modified ) _e('Unpublished'); else the_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?></td>

View File

@ -30,12 +30,27 @@ if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($
<?php
wp("what_to_show=posts$post_status_q&posts_per_page=15");
if ( 'pending' === $_GET['post_status'] ) {
$order = 'ASC';
$orderby = 'modified';
} elseif ( 'draft' === $_GET['post_status'] ) {
$order = 'DESC';
$orderby = 'modified';
} else {
$order = 'DESC';
$orderby = 'date';
}
wp("what_to_show=posts$post_status_q&posts_per_page=15&order=$order&orderby=$orderby");
// define the columns to display, the syntax is 'internal name' => 'display name'
$posts_columns = array();
$posts_columns['id'] = '<div style="text-align: center">' . __('ID') . '</div>';
if ( !in_array($_GET['post_status'], array('pending', 'draft')) )
if ( 'draft' === $_GET['post_status'] )
$posts_columns['modified'] = __('Modified');
elseif ( 'pending' === $_GET['post_status'] )
$posts_columns['modified'] = __('Submitted');
else
$posts_columns['date'] = __('When');
$posts_columns['title'] = __('Title');
$posts_columns['categories'] = __('Categories');