summaryrefslogtreecommitdiffstats
path: root/wp-admin/index.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-24 17:00:10 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-24 17:00:10 +0000
commit631c9bb4d60d242432052f56c00768392f42a392 (patch)
tree50d41b0248d5c5fb156c6d52020675208b77a3e6 /wp-admin/index.php
parenta1fbe4e0694a66d7351e2f6280ab84568681e8e0 (diff)
downloadwordpress-mu-631c9bb4d60d242432052f56c00768392f42a392.tar.gz
wordpress-mu-631c9bb4d60d242432052f56c00768392f42a392.tar.xz
wordpress-mu-631c9bb4d60d242432052f56c00768392f42a392.zip
WP Merge to revision 8180
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1336 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/index.php')
-rw-r--r--wp-admin/index.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/wp-admin/index.php b/wp-admin/index.php
index 3a10bcf..3cc9e3d 100644
--- a/wp-admin/index.php
+++ b/wp-admin/index.php
@@ -60,6 +60,8 @@ $num_cats = wp_count_terms('category');
$num_tags = wp_count_terms('post_tag');
+$num_comm = get_comment_count( );
+
$post_type_texts = array();
if ( !empty($num_posts->publish) ) { // with feeds, anyone can tell how many posts there are. Just unlink if !current_user_can
@@ -89,18 +91,31 @@ if ( current_user_can( 'manage_categories' ) ) {
$tags_text = "<a href='edit-tags.php'>$tags_text</a>";
}
+$total_comments = sprintf( __( '%1$s total' ), $num_comm['total_comments'] );
+$approved_comments = sprintf( __( '%1$s approved' ), $num_comm['approved'] );
+$spam_comments = sprintf( __( '%1$s spam' ), $num_comm['spam'] );
+$moderated_comments = sprintf( __( '%1$s awaiting moderation' ), $num_comm['awaiting_moderation'] );
+
+if( current_user_can( 'moderate_comments' ) ) {
+ $total_comments = "<a href='edit-comments.php'>{$total_comments}</a>";
+ $approved_comments = "<a href='edit-comments.php?comment_status=approved'>{$approved_comments}</a>";
+ $moderated_comments = "<a href='edit-comments.php?comment_status=moderated'>{$moderated_comments}</a>";
+}
+
+$comm_text = sprintf( __( 'Current comment break down: %1$s, %2$s, %3$s and %4$s.' ), $total_comments, $approved_comments, $spam_comments, $moderated_comments );
+
$post_type_text = implode(', ', $post_type_texts);
// There is always a category
-$sentence = sprintf( __( 'You have %1$s, contained within %2$s and %3$s. %4$s' ), $post_type_text, $cats_text, $tags_text, $pending_text );
-$sentence = apply_filters( 'dashboard_count_sentence', $sentence, $post_type_text, $cats_text, $tags_text, $pending_text );
+$sentence = sprintf( __( 'You have %1$s, contained within %2$s and %3$s. %4$s %5$s' ), $post_type_text, $cats_text, $tags_text, $pending_text, $comm_text );
+$sentence = apply_filters( 'dashboard_count_sentence', $sentence, $post_type_text, $cats_text, $tags_text, $pending_text, $comm_text );
?>
<p class="youhave"><?php echo $sentence; ?></p>
<?php
$ct = current_theme_info();
$sidebars_widgets = wp_get_sidebars_widgets();
-$num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ) );
+$num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ), 0 );
$widgets_text = sprintf( __ngettext( '%d widget', '%d widgets', $num_widgets ), $num_widgets );
if ( $can_switch_themes = current_user_can( 'switch_themes' ) )
$widgets_text = "<a href='widgets.php'>$widgets_text</a>";