WordPress.org

Make WordPress Core

Ticket #43084: 43084.diff

File 43084.diff, 1.3 KB (added by susiyanti, 2 years ago)

Fixed links in dashboard "at a glance" section for Post/Page number lead to 'Published' post/page, and Comment number to 'Approved' comment.

  • src/wp-admin/includes/dashboard.php

     
    276276                        $text             = sprintf( $text, number_format_i18n( $num_posts->publish ) );
    277277                        $post_type_object = get_post_type_object( $post_type );
    278278                        if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) {
    279                                 printf( '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s</a></li>', $post_type, $text );
     279                                printf( '<li class="%1$s-count"><a href="edit.php?post_status=publish&post_type=%1$s">%2$s</a></li>', $post_type, $text );
    280280                        } else {
    281281                                printf( '<li class="%1$s-count"><span>%2$s</span></li>', $post_type, $text );
    282282                        }
     
    287287        if ( $num_comm && ( $num_comm->approved || $num_comm->moderated ) ) {
    288288                $text = sprintf( _n( '%s Comment', '%s Comments', $num_comm->approved ), number_format_i18n( $num_comm->approved ) );
    289289                ?>
    290                 <li class="comment-count"><a href="edit-comments.php"><?php echo $text; ?></a></li>
     290                <li class="comment-count"><a href="edit-comments.php?comment_status=approved"><?php echo $text; ?></a></li>
    291291                <?php
    292292                $moderated_comments_count_i18n = number_format_i18n( $num_comm->moderated );
    293293                /* translators: %s: number of comments in moderation */