First cut at post status menu. Needs style fixes.

git-svn-id: http://svn.automattic.com/wordpress/trunk@6731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-02-05 20:30:24 +00:00
parent b85271e8ed
commit 3587caeb53
3 changed files with 45 additions and 5 deletions

View File

@ -54,6 +54,29 @@ if ( is_single() ) {
}
?></h2>
<ul id="statusmenu">
<?php
$status_links = array();
foreach ( $post_stati as $status => $label ) {
$class = '';
if ( !in_array($status, $avail_post_stati) )
continue;
$num_posts = wp_count_posts('post', $status);
if ( $status == $_GET['post_status'] )
$class = ' class="current"';
$status_links[] = "<li><a href=\"edit.php?post_status=$status\"$class>" .
sprintf($label[1], $num_posts) . '</a>';
}
$class = empty($_GET['post_status']) ? ' class="current"' : '';
$status_links[] = "<li><a href=\"edit.php\"$class>All Posts</a>";
echo implode(' |</li>', $status_links) . '</li>';
unset($status_links);
?>
</ul>
<form name="searchform" id="searchform" action="" method="get">
<fieldset><legend><?php _e('Search terms&hellip;'); ?></legend>
<input type="text" name="s" id="s" value="<?php the_search_query(); ?>" size="17" />

View File

@ -488,11 +488,11 @@ function wp_edit_posts_query( $q = false ) {
$q['m'] = (int) $q['m'];
$q['cat'] = (int) $q['cat'];
$post_stati = array( // array( adj, noun )
'draft' => array(__('Draft'), _c('Drafts|manage posts header')),
'future' => array(__('Scheduled'), __('Scheduled posts')),
'pending' => array(__('Pending Review'), __('Pending posts')),
'private' => array(__('Private'), __('Private posts')),
'publish' => array(__('Published'), __('Published posts'))
'publish' => array(__('Published'), __('Published (%s)')),
'future' => array(__('Scheduled'), __('Scheduled (5s)')),
'pending' => array(__('Pending Review'), __('Pending Review (%s)')),
'draft' => array(__('Draft'), _c('Draft (%s)|manage posts header')),
'private' => array(__('Private'), __('Private (%s)'))
);
$avail_post_stati = $wpdb->get_col("SELECT DISTINCT post_status FROM $wpdb->posts WHERE post_type = 'post'");

View File

@ -995,6 +995,23 @@ a.view-comment-post-link {
height: 15px;
}
#statusmenu {
margin: 0;
color: #999;
list-style: none;
white-space: nowrap;
left: 0;
}
#statusmenu a {
color: #2583ad;
padding: 3px;
line-height: 200%;
}
#statusmenu a:hover, #statusmenu a.current, #statusmenu a.current:hover {
color: #d54e21;
}
/* end menu stuff */
/* Admin Footer */