From 6f194fb37b1af5552741423003e7eeab353e4896 Mon Sep 17 00:00:00 2001 From: SirLouen Date: Thu, 13 Nov 2025 17:04:53 +0100 Subject: [PATCH 1/3] dashboard confuses published posts count with all posts --- src/wp-admin/includes/dashboard.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index cac03b1fe3630..58f06ed76a140 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -309,17 +309,17 @@ function wp_dashboard_right_now() { if ( $num_posts && $num_posts->publish ) { if ( 'post' === $post_type ) { /* translators: %s: Number of posts. */ - $text = _n( '%s Post', '%s Posts', $num_posts->publish ); + $text = _n( '%s Published post', '%s Published posts', $num_posts->publish ); } else { /* translators: %s: Number of pages. */ - $text = _n( '%s Page', '%s Pages', $num_posts->publish ); + $text = _n( '%s Published page', '%s Published pages', $num_posts->publish ); } $text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); $post_type_object = get_post_type_object( $post_type ); if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) { - printf( '
  • %2$s
  • ', $post_type, $text ); + printf( '
  • %2$s
  • ', $post_type, $text ); } else { printf( '
  • %2$s
  • ', $post_type, $text ); } From 91f19091fd2299f57199f0b423e28a5185c61966 Mon Sep 17 00:00:00 2001 From: SirLouen Date: Wed, 26 Nov 2025 18:06:14 +0100 Subject: [PATCH 2/3] fix: Improve translation strings and update URL handling for published posts --- src/wp-admin/includes/dashboard.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 58f06ed76a140..5fcb53e77ce21 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -309,17 +309,24 @@ function wp_dashboard_right_now() { if ( $num_posts && $num_posts->publish ) { if ( 'post' === $post_type ) { /* translators: %s: Number of posts. */ - $text = _n( '%s Published post', '%s Published posts', $num_posts->publish ); + $text = _n( '%s Published Post', '%s Published Posts', $num_posts->publish ); } else { /* translators: %s: Number of pages. */ - $text = _n( '%s Published page', '%s Published pages', $num_posts->publish ); + $text = _n( '%s Published Page', '%s Published Pages', $num_posts->publish ); } $text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); $post_type_object = get_post_type_object( $post_type ); if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) { - printf( '
  • %2$s
  • ', $post_type, $text ); + $url = add_query_arg( + array( + 'post_status' => 'publish', + 'post_type' => $post_type, + ), + admin_url( 'edit.php' ) + ); + printf( '
  • %2$s
  • ', esc_url( $url ), esc_html( $text ) ); } else { printf( '
  • %2$s
  • ', $post_type, $text ); } From 4be6beb6c8e96d312717d582f3705baa8c95c3c8 Mon Sep 17 00:00:00 2001 From: SirLouen Date: Wed, 26 Nov 2025 18:08:40 +0100 Subject: [PATCH 3/3] fix: Revert translation strings for published posts and pages --- src/wp-admin/includes/dashboard.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 5fcb53e77ce21..aad044c70b234 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -309,10 +309,10 @@ function wp_dashboard_right_now() { if ( $num_posts && $num_posts->publish ) { if ( 'post' === $post_type ) { /* translators: %s: Number of posts. */ - $text = _n( '%s Published Post', '%s Published Posts', $num_posts->publish ); + $text = _n( '%s Published post', '%s Published posts', $num_posts->publish ); } else { /* translators: %s: Number of pages. */ - $text = _n( '%s Published Page', '%s Published Pages', $num_posts->publish ); + $text = _n( '%s Published page', '%s Published pages', $num_posts->publish ); } $text = sprintf( $text, number_format_i18n( $num_posts->publish ) );