- global $wp_registered_sidebars;
-
- $num_posts = wp_count_posts( 'post' );
- $num_pages = wp_count_posts( 'page' );
-
- $num_cats = wp_count_terms('category');
-
- $num_tags = wp_count_terms('post_tag');
-
- $num_comm = wp_count_comments( );
-
- echo "\n\t".'<div class="table table_content">';
- echo "\n\t".'<p class="sub">' . __('Content') . '</p>'."\n\t".'<table>';
- echo "\n\t".'<tr class="first">';
-
- // Posts
- $num = number_format_i18n( $num_posts->publish );
- $text = _n( 'Post', 'Posts', intval($num_posts->publish) );
- if ( current_user_can( 'edit_posts' ) ) {
- $num = "<a href='edit.php'>$num</a>";
- $text = "<a href='edit.php'>$text</a>";
- }
- echo '<td class="first b b-posts">' . $num . '</td>';
- echo '<td class="t posts">' . $text . '</td>';
-
- echo '</tr><tr>';
- /* TODO: Show status breakdown on hover
- if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can
- $post_type_texts[] = '<a href="edit-pages.php">'.sprintf( _n( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>';
- }
- if ( $can_edit_posts && !empty($num_posts->draft) ) {
- $post_type_texts[] = '<a href="edit.php?post_status=draft">'.sprintf( _n( '%s draft', '%s drafts', $num_posts->draft ), number_format_i18n( $num_posts->draft ) ).'</a>';
- }
- if ( $can_edit_posts && !empty($num_posts->future) ) {
- $post_type_texts[] = '<a href="edit.php?post_status=future">'.sprintf( _n( '%s scheduled post', '%s scheduled posts', $num_posts->future ), number_format_i18n( $num_posts->future ) ).'</a>';
- }
- if ( current_user_can('publish_posts') && !empty($num_posts->pending) ) {
- $pending_text = sprintf( _n( 'There is <a href="%1$s">%2$s post</a> pending your review.', 'There are <a href="%1$s">%2$s posts</a> pending your review.', $num_posts->pending ), 'edit.php?post_status=pending', number_format_i18n( $num_posts->pending ) );
- } else {
- $pending_text = '';
- }
- */
-
- // Pages
- $num = number_format_i18n( $num_pages->publish );
- $text = _n( 'Page', 'Pages', $num_pages->publish );
- if ( current_user_can( 'edit_pages' ) ) {
- $num = "<a href='edit.php?post_type=page'>$num</a>";
- $text = "<a href='edit.php?post_type=page'>$text</a>";
- }
- echo '<td class="first b b_pages">' . $num . '</td>';
- echo '<td class="t pages">' . $text . '</td>';
-
- echo '</tr><tr>';
-
- // Categories
- $num = number_format_i18n( $num_cats );
- $text = _n( 'Category', 'Categories', $num_cats );
- if ( current_user_can( 'manage_categories' ) ) {
- $num = "<a href='edit-tags.php?taxonomy=category'>$num</a>";
- $text = "<a href='edit-tags.php?taxonomy=category'>$text</a>";
- }
- echo '<td class="first b b-cats">' . $num . '</td>';
- echo '<td class="t cats">' . $text . '</td>';
-
- echo '</tr><tr>';
-
- // Tags
- $num = number_format_i18n( $num_tags );
- $text = _n( 'Tag', 'Tags', $num_tags );
- if ( current_user_can( 'manage_categories' ) ) {
- $num = "<a href='edit-tags.php'>$num</a>";
- $text = "<a href='edit-tags.php'>$text</a>";
- }
- echo '<td class="first b b-tags">' . $num . '</td>';
- echo '<td class="t tags">' . $text . '</td>';
-
- echo "</tr>";
- do_action('right_now_content_table_end');
- echo "\n\t</table>\n\t</div>";
-
-
- echo "\n\t".'<div class="table table_discussion">';
- echo "\n\t".'<p class="sub">' . __('Discussion') . '</p>'."\n\t".'<table>';
- echo "\n\t".'<tr class="first">';
+?>
+ <div class="main">
+ <ul>
+ <?php
+ // Posts and Pages
+ foreach ( array( 'post', 'page' ) as $post_type ) {
+ $num_posts = wp_count_posts( $post_type );
+ if ( $num_posts && $num_posts->publish ) {
+ if ( 'post' == $post_type ) {
+ $text = _n( '%s Post', '%s Posts', $num_posts->publish );
+ } else {
+ $text = _n( '%s Page', '%s Pages', $num_posts->publish );
+ }
+ $text = sprintf( $text, number_format_i18n( $num_posts->publish ) );
+ $post_type_object = get_post_type_object( $post_type );
+ if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) {
+ printf( '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s</a></li>', $post_type, $text );
+ } else {
+ printf( '<li class="%1$s-count"><span>%2$s</span></li>', $post_type, $text );
+ }