Make WordPress Core

Ticket #61486: 61486.diff

File 61486.diff, 1.4 KB (added by domainsupport, 17 months ago)
  • src/wp-admin/includes/dashboard.php

     
    303303        <ul>
    304304        <?php
    305305        // Posts and Pages.
    306         foreach ( array( 'post', 'page' ) as $post_type ) {
     306        foreach ( get_post_types( array( 'public' => 'true' ) ) as $post_type ) {
    307307                $num_posts = wp_count_posts( $post_type );
    308308
    309309                if ( $num_posts && $num_posts->publish ) {
     310                        $post_type_object = get_post_type_object( $post_type );
     311
    310312                        if ( 'post' === $post_type ) {
    311313                                /* translators: %s: Number of posts. */
    312314                                $text = _n( '%s Post', '%s Posts', $num_posts->publish );
     315                        } elseif ( 'page' === $post_type ) {
     316                                /* translators: %s: Number of pages. */
     317                                $text = _n( '%s Page', '%s Pages', $num_posts->publish );
    313318                        } else {
    314319                                /* translators: %s: Number of pages. */
    315                                 $text = _n( '%s Page', '%s Pages', $num_posts->publish );
     320                                $text = _n( '%s ' . $post_type_object->labels->singular_name, '%s ' . $post_type_object->labels->name, $num_posts->publish );
    316321                        }
    317322
    318323                        $text             = sprintf( $text, number_format_i18n( $num_posts->publish ) );
    319                         $post_type_object = get_post_type_object( $post_type );
    320324
    321325                        if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) {
    322326                                printf( '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s</a></li>', $post_type, $text );