Make titles into links in Dashboard Right Now module, props mattwalters, fixes #8438 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@10300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-01-05 10:08:31 +00:00
parent ec1ca2236f
commit c045b1a045

View File

@ -181,12 +181,13 @@ function wp_dashboard_right_now() {
// Posts // Posts
$num = number_format_i18n( $num_posts->publish ); $num = number_format_i18n( $num_posts->publish );
if ( current_user_can( 'edit_posts' ) ) $text = __ngettext( 'Post', 'Posts', intval($num_posts->publish) );
$text = "<a href='edit.php'>$num</a>"; if ( current_user_can( 'edit_posts' ) ) {
else $num = "<a href='edit.php'>$num</a>";
$text = $num; $text = "<a href='edit.php'>$text</a>";
echo '<td class="first b b-posts">' . $text . '</td>'; }
echo '<td class="t posts">' . __ngettext( 'Post', 'Posts', intval($num_posts->publish) ) . '</td>'; echo '<td class="first b b-posts">' . $num . '</td>';
echo '<td class="t posts">' . $text . '</td>';
/* TODO: Show status breakdown on hover /* 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 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( __ngettext( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>'; $post_type_texts[] = '<a href="edit-pages.php">'.sprintf( __ngettext( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>';
@ -206,58 +207,79 @@ function wp_dashboard_right_now() {
// Total Comments // Total Comments
$num = number_format_i18n($num_comm->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 = "<a href='edit-comments.php'>$num</a>"; $num = "<a href='edit-comments.php'>$num</a>";
echo '<td class="b b-comments">'.$num.'</td>'; $text = "<a href='edit-comments.php'>$text</a>";
echo '<td class="last t comments">' . __ngettext( 'Comment', 'Comments', $num_comm->total_comments ) . '</td>'; }
echo '<td class="b b-comments">' . $num . '</td>';
echo '<td class="last t comments">' . $text . '</td>';
echo '</tr><tr>'; echo '</tr><tr>';
// Pages // Pages
$num = number_format_i18n( $num_pages->publish ); $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 = "<a href='edit-pages.php'>$num</a>"; $num = "<a href='edit-pages.php'>$num</a>";
echo '<td class="first b b_pages">'.$num.'</td>'; $text = "<a href='edit-pages.php'>$text</a>";
echo '<td class="t pages">' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . '</td>'; }
echo '<td class="first b b_pages">' . $num . '</td>';
echo '<td class="t pages">' . $text . '</td>';
// Approved Comments // Approved Comments
$num = number_format_i18n($num_comm->approved); $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 = "<a href='edit-comments.php?comment_status=approved'>$num</a>"; $num = "<a href='edit-comments.php?comment_status=approved'>$num</a>";
echo '<td class="b b_approved">'.$num.'</td>'; $text = "<a class='approved' href='edit-comments.php?comment_status=approved'>$text</a>";
echo '<td class="last t approved">' . __ngettext( 'Approved', 'Approved', $num_comm->approved ) . '</td>'; }
echo '<td class="b b_approved">' . $num . '</td>';
echo '<td class="last t">' . $text . '</td>';
echo "</tr>\n\t<tr>"; echo "</tr>\n\t<tr>";
// Categories // Categories
$num = number_format_i18n( $num_cats ); $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 = "<a href='categories.php'>$num</a>"; $num = "<a href='categories.php'>$num</a>";
echo '<td class="first b b-cats">'.$num.'</td>'; $text = "<a href='categories.php'>$text</a>";
echo '<td class="t cats">' . __ngettext( 'Category', 'Categories', $num_cats ) . '</td>'; }
echo '<td class="first b b-cats">' . $num . '</td>';
echo '<td class="t cats">' . $text . '</td>';
// Pending Comments // Pending Comments
$num = number_format_i18n($num_comm->moderated); $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 = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>"; $num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>";
echo '<td class="b b-waiting">'.$num.'</td>'; $text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>$text</a>";
echo '<td class="last t waiting">' . __ngettext( 'Pending', 'Pending', $num_comm->moderated ) . '</td>'; }
echo '<td class="b b-waiting">' . $num . '</td>';
echo '<td class="last t">' . $text . '</td>';
echo "</tr>\n\t<tr>"; echo "</tr>\n\t<tr>";
// Tags // Tags
$num = number_format_i18n( $num_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 = "<a href='edit-tags.php'>$num</a>"; $num = "<a href='edit-tags.php'>$num</a>";
echo '<td class="first b b-tags">'.$num.'</td>'; $text = "<a href='edit-tags.php'>$text</a>";
echo '<td class="t tags">' . __ngettext( 'Tag', 'Tags', $num_tags ) . '</td>'; }
echo '<td class="first b b-tags">' . $num . '</td>';
echo '<td class="t tags">' . $text . '</td>';
// Spam Comments // Spam Comments
$num = number_format_i18n($num_comm->spam); $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 = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>"; $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>";
echo '<td class="b b-spam">'.$num.'</td>'; $text = "<a class='spam' href='edit-comments.php?comment_status=spam'>$text</a>";
echo '<td class="last t spam">' . __ngettext( 'Spam', 'Spam', $num_comm->spam ) . '</td>'; }
echo '<td class="b b-spam">' . $num . '</td>';
echo '<td class="last t">' . $text . '</td>';
echo "</tr>"; echo "</tr>";
do_action('right_now_table_end'); do_action('right_now_table_end');