Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r10299 r10154  
    182182    // Posts
    183183    $num = number_format_i18n( $num_posts->publish );
    184     $text = __ngettext( 'Post', 'Posts', intval($num_posts->publish) );
    185     if ( current_user_can( 'edit_posts' ) ) {
    186         $num = "<a href='edit.php'>$num</a>";
    187         $text = "<a href='edit.php'>$text</a>";
    188     }
    189     echo '<td class="first b b-posts">' . $num . '</td>';
    190     echo '<td class="t posts">' . $text . '</td>';
     184    if ( current_user_can( 'edit_posts' ) )
     185        $text = "<a href='edit.php'>$num</a>";
     186    else
     187        $text = $num;
     188    echo '<td class="first b b-posts">' . $text . '</td>';
     189    echo '<td class="t posts">' . __ngettext( 'Post', 'Posts', intval($num_posts->publish) ) . '</td>';
    191190    /* TODO: Show status breakdown on hover
    192191    if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds.  Don't show if !current_user_can
     
    208207    // Total Comments
    209208    $num = number_format_i18n($num_comm->total_comments);
    210     $text = __ngettext( 'Comment', 'Comments', $num_comm->total_comments );
    211     if ( current_user_can( 'moderate_comments' ) ) {
     209    if ( current_user_can( 'moderate_comments' ) )
    212210        $num = "<a href='edit-comments.php'>$num</a>";
    213         $text = "<a href='edit-comments.php'>$text</a>";
    214     }
    215     echo '<td class="b b-comments">' . $num . '</td>';
    216     echo '<td class="last t comments">' . $text . '</td>';
     211    echo '<td class="b b-comments">'.$num.'</td>';
     212    echo '<td class="last t comments">' . __ngettext( 'Comment', 'Comments', $num_comm->total_comments ) . '</td>';
    217213
    218214    echo '</tr><tr>';
     
    220216    // Pages
    221217    $num = number_format_i18n( $num_pages->publish );
    222     $text = __ngettext( 'Page', 'Pages', $num_pages->publish );
    223     if ( current_user_can( 'edit_pages' ) ) {
     218    if ( current_user_can( 'edit_pages' ) )
    224219        $num = "<a href='edit-pages.php'>$num</a>";
    225         $text = "<a href='edit-pages.php'>$text</a>";
    226     }
    227     echo '<td class="first b b_pages">' . $num . '</td>';
    228     echo '<td class="t pages">' . $text . '</td>';
     220    echo '<td class="first b b_pages">'.$num.'</td>';
     221    echo '<td class="t pages">' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . '</td>';
    229222
    230223    // Approved Comments
    231224    $num = number_format_i18n($num_comm->approved);
    232     $text = __ngettext( 'Approved', 'Approved', $num_comm->approved );
    233     if ( current_user_can( 'moderate_comments' ) ) {
     225    if ( current_user_can( 'moderate_comments' ) )
    234226        $num = "<a href='edit-comments.php?comment_status=approved'>$num</a>";
    235         $text = "<a class='approved' href='edit-comments.php?comment_status=approved'>$text</a>";
    236     }
    237     echo '<td class="b b_approved">' . $num . '</td>';
    238     echo '<td class="last t">' . $text . '</td>';
     227    echo '<td class="b b_approved">'.$num.'</td>';
     228    echo '<td class="last t approved">' . __ngettext( 'Approved', 'Approved', $num_comm->approved ) . '</td>';
    239229
    240230    echo "</tr>\n\t<tr>";
     
    242232    // Categories
    243233    $num = number_format_i18n( $num_cats );
    244     $text = __ngettext( 'Category', 'Categories', $num_cats );
    245     if ( current_user_can( 'manage_categories' ) ) {
     234    if ( current_user_can( 'manage_categories' ) )
    246235        $num = "<a href='categories.php'>$num</a>";
    247         $text = "<a href='categories.php'>$text</a>";
    248     }
    249     echo '<td class="first b b-cats">' . $num . '</td>';
    250     echo '<td class="t cats">' . $text . '</td>';
     236    echo '<td class="first b b-cats">'.$num.'</td>';
     237    echo '<td class="t cats">' . __ngettext( 'Category', 'Categories', $num_cats ) . '</td>';
    251238
    252239    // Pending Comments
    253240    $num = number_format_i18n($num_comm->moderated);
    254     $text = __ngettext( 'Pending', 'Pending', $num_comm->moderated );
    255     if ( current_user_can( 'moderate_comments' ) ) {
     241    if ( current_user_can( 'moderate_comments' ) )
    256242        $num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>";
    257         $text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>$text</a>";
    258     }
    259     echo '<td class="b b-waiting">' . $num . '</td>';
    260     echo '<td class="last t">' . $text . '</td>';
     243    echo '<td class="b b-waiting">'.$num.'</td>';
     244    echo '<td class="last t waiting">' . __ngettext( 'Pending', 'Pending', $num_comm->moderated ) . '</td>';
    261245
    262246    echo "</tr>\n\t<tr>";
     
    264248    // Tags
    265249    $num = number_format_i18n( $num_tags );
    266     $text = __ngettext( 'Tag', 'Tags', $num_tags );
    267     if ( current_user_can( 'manage_categories' ) ) {
     250    if ( current_user_can( 'manage_categories' ) )
    268251        $num = "<a href='edit-tags.php'>$num</a>";
    269         $text = "<a href='edit-tags.php'>$text</a>";
    270     }
    271     echo '<td class="first b b-tags">' . $num . '</td>';
    272     echo '<td class="t tags">' . $text . '</td>';
     252    echo '<td class="first b b-tags">'.$num.'</td>';
     253    echo '<td class="t tags">' . __ngettext( 'Tag', 'Tags', $num_tags ) . '</td>';
    273254
    274255    // Spam Comments
    275256    $num = number_format_i18n($num_comm->spam);
    276     $text = __ngettext( 'Spam', 'Spam', $num_comm->spam );
    277     if ( current_user_can( 'moderate_comments' ) ) {
     257    if ( current_user_can( 'moderate_comments' ) )
    278258        $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>";
    279         $text = "<a class='spam' href='edit-comments.php?comment_status=spam'>$text</a>";
    280     }
    281     echo '<td class="b b-spam">' . $num . '</td>';
    282     echo '<td class="last t">' . $text . '</td>';
     259    echo '<td class="b b-spam">'.$num.'</td>';
     260    echo '<td class="last t spam">' . __ngettext( 'Spam', 'Spam', $num_comm->spam ) . '</td>';
    283261
    284262    echo "</tr>";
     
    304282    update_right_now_message();
    305283
    306     echo "\n\t".'<br class="clear" /></div>';
     284    echo "\n\t".'</div>';
    307285    do_action( 'rightnow_end' );
    308286    do_action( 'activity_box_end' );
Note: See TracChangeset for help on using the changeset viewer.