From b79698dc1e3a4cd57c39a3ee16ef755891a0ecf4 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 5 Jan 2009 10:08:31 +0000 Subject: [PATCH] Make titles into links in Dashboard Right Now module, props mattwalters, fixes #8438 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@10300 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/dashboard.php | 76 +++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 27 deletions(-) diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index f9baf78d18..b08615f93d 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -181,12 +181,13 @@ function wp_dashboard_right_now() { // Posts $num = number_format_i18n( $num_posts->publish ); - if ( current_user_can( 'edit_posts' ) ) - $text = "$num"; - else - $text = $num; - echo '' . $text . ''; - echo '' . __ngettext( 'Post', 'Posts', intval($num_posts->publish) ) . ''; + $text = __ngettext( 'Post', 'Posts', intval($num_posts->publish) ); + if ( current_user_can( 'edit_posts' ) ) { + $num = "$num"; + $text = "$text"; + } + echo '' . $num . ''; + echo '' . $text . ''; /* 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[] = ''.sprintf( __ngettext( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).''; @@ -206,58 +207,79 @@ function wp_dashboard_right_now() { // Total Comments $num = number_format_i18n($num_comm->total_comments); - if ( current_user_can( 'moderate_comments' ) ) + $text = __ngettext( 'Comment', 'Comments', $num_comm->total_comments ); + if ( current_user_can( 'moderate_comments' ) ) { $num = "$num"; - echo ''.$num.''; - echo '' . __ngettext( 'Comment', 'Comments', $num_comm->total_comments ) . ''; + $text = "$text"; + } + echo '' . $num . ''; + echo '' . $text . ''; echo ''; // Pages $num = number_format_i18n( $num_pages->publish ); - if ( current_user_can( 'edit_pages' ) ) + $text = __ngettext( 'Page', 'Pages', $num_pages->publish ); + if ( current_user_can( 'edit_pages' ) ) { $num = "$num"; - echo ''.$num.''; - echo '' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . ''; + $text = "$text"; + } + echo '' . $num . ''; + echo '' . $text . ''; // Approved Comments $num = number_format_i18n($num_comm->approved); - if ( current_user_can( 'moderate_comments' ) ) + $text = __ngettext( 'Approved', 'Approved', $num_comm->approved ); + if ( current_user_can( 'moderate_comments' ) ) { $num = "$num"; - echo ''.$num.''; - echo '' . __ngettext( 'Approved', 'Approved', $num_comm->approved ) . ''; + $text = "$text"; + } + echo '' . $num . ''; + echo '' . $text . ''; echo "\n\t"; // Categories $num = number_format_i18n( $num_cats ); - if ( current_user_can( 'manage_categories' ) ) + $text = __ngettext( 'Category', 'Categories', $num_cats ); + if ( current_user_can( 'manage_categories' ) ) { $num = "$num"; - echo ''.$num.''; - echo '' . __ngettext( 'Category', 'Categories', $num_cats ) . ''; + $text = "$text"; + } + echo '' . $num . ''; + echo '' . $text . ''; // Pending Comments $num = number_format_i18n($num_comm->moderated); - if ( current_user_can( 'moderate_comments' ) ) + $text = __ngettext( 'Pending', 'Pending', $num_comm->moderated ); + if ( current_user_can( 'moderate_comments' ) ) { $num = "$num"; - echo ''.$num.''; - echo '' . __ngettext( 'Pending', 'Pending', $num_comm->moderated ) . ''; + $text = "$text"; + } + echo '' . $num . ''; + echo '' . $text . ''; echo "\n\t"; // Tags $num = number_format_i18n( $num_tags ); - if ( current_user_can( 'manage_categories' ) ) + $text = __ngettext( 'Tag', 'Tags', $num_tags ); + if ( current_user_can( 'manage_categories' ) ) { $num = "$num"; - echo ''.$num.''; - echo '' . __ngettext( 'Tag', 'Tags', $num_tags ) . ''; + $text = "$text"; + } + echo '' . $num . ''; + echo '' . $text . ''; // Spam Comments $num = number_format_i18n($num_comm->spam); - if ( current_user_can( 'moderate_comments' ) ) + $text = __ngettext( 'Spam', 'Spam', $num_comm->spam ); + if ( current_user_can( 'moderate_comments' ) ) { $num = "$num"; - echo ''.$num.''; - echo '' . __ngettext( 'Spam', 'Spam', $num_comm->spam ) . ''; + $text = "$text"; + } + echo '' . $num . ''; + echo '' . $text . ''; echo ""; do_action('right_now_table_end');