Ticket #61486: 61486.diff
| File 61486.diff, 1.4 KB (added by , 17 months ago) |
|---|
-
src/wp-admin/includes/dashboard.php
303 303 <ul> 304 304 <?php 305 305 // Posts and Pages. 306 foreach ( array( 'post', 'page') as $post_type ) {306 foreach ( get_post_types( array( 'public' => 'true' ) ) as $post_type ) { 307 307 $num_posts = wp_count_posts( $post_type ); 308 308 309 309 if ( $num_posts && $num_posts->publish ) { 310 $post_type_object = get_post_type_object( $post_type ); 311 310 312 if ( 'post' === $post_type ) { 311 313 /* translators: %s: Number of posts. */ 312 314 $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 ); 313 318 } else { 314 319 /* 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 ); 316 321 } 317 322 318 323 $text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); 319 $post_type_object = get_post_type_object( $post_type );320 324 321 325 if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) { 322 326 printf( '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s</a></li>', $post_type, $text );