Make WordPress Core

Ticket #26066: 26066.patch

File 26066.patch, 1.5 KB (added by SergeyBiryukov, 12 years ago)
  • src/wp-admin/includes/dashboard.php

     
    179179        <ul>
    180180        <?php
    181181        do_action( 'rightnow_list_start' );
    182         // Using show_in_nav_menus as my arg for grabbing what post types should show, is there better?
    183         $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
    184         $post_types = (array) apply_filters( 'rightnow_post_types', $post_types );
    185         foreach ( $post_types as $post_type => $post_type_obj ){
     182        // Posts and Pages
     183        foreach ( array( 'post', 'page' ) as $post_type ) {
    186184                $num_posts = wp_count_posts( $post_type );
    187185                if ( $num_posts && $num_posts->publish ) {
     186                        if ( 'post' == $post_type )
     187                                $text = _n( 'Post', 'Posts', $num_posts->publish );
     188                        else
     189                                $text = _n( 'Page', 'Pages', $num_posts->publish );
    188190                        printf(
    189191                                '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s %3$s</a></li>',
    190192                                $post_type,
    191193                                number_format_i18n( $num_posts->publish ),
    192                                 $post_type_obj->label
     194                                $text
    193195                        );
    194196                }
    195197        }
     
    203205                        $text
    204206                );
    205207                if ( $num_comm->moderated ) {
    206                         $text = _n( 'in moderation', 'in moderation', $num_comm->total_comments );
     208                        $text = _n( 'in moderation', 'in moderation', $num_comm->moderated );
    207209                        printf(
    208210                                '<li class="comment-mod-count"><a href="edit-comments.php?comment_status=moderated">%1$s %2$s</a></li>',
    209211                                number_format_i18n( $num_comm->moderated ),