WordPress.org

Make WordPress Core

Ticket #6471: index.php.diff

File index.php.diff, 1.8 KB (added by josephscott, 6 years ago)
  • index.php

     
    6464 
    6565$num_tags = wp_count_terms('post_tag'); 
    6666 
     67$num_comm = get_comment_count( ); 
     68 
    6769$post_type_texts = array(); 
    6870 
    6971if ( !empty($num_posts->publish) ) { // with feeds, anyone can tell how many posts there are.  Just unlink if !current_user_can 
     
    9395        $tags_text = "<a href='edit-tags.php'>$tags_text</a>"; 
    9496} 
    9597 
     98$total_comments = sprintf( __( '%1$s total' ), $num_comm['total_comments'] ); 
     99$approved_comments = sprintf( __( '%1$s approved' ), $num_comm['approved'] ); 
     100$spam_comments = sprintf( __( '%1$s spam' ), $num_comm['spam'] ); 
     101$moderated_comments = sprintf( __( '%1$s awaiting moderation' ), $num_comm['awaiting_moderation'] ); 
     102 
     103if( current_user_can( 'moderate_comments' ) ) { 
     104        $total_comments = "<a href='edit-comments.php'>{$total_comments}</a>"; 
     105        $approved_comments = "<a href='edit-comments.php?comment_status=approved'>{$approved_comments}</a>"; 
     106        $moderated_comments = "<a href='edit-comments.php?comment_status=moderated'>{$moderated_comments}</a>"; 
     107} 
     108 
     109$comm_text = sprintf( __( 'Current comment break down: %1$s, %2$s, %3$s and %4$s.' ), $total_comments, $approved_comments, $spam_comments, $moderated_comments ); 
     110 
    96111$post_type_text = implode(', ', $post_type_texts); 
    97112 
    98113// There is always a category 
    99 $sentence = sprintf( __( 'You have %1$s, contained within %2$s and %3$s. %4$s' ), $post_type_text, $cats_text, $tags_text, $pending_text ); 
     114$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 ); 
    100115$sentence = apply_filters( 'dashboard_count_sentence', $sentence, $post_type_text, $cats_text, $tags_text, $pending_text ); 
    101116 
    102117?>