Skip to content

Commit 91f1909

Browse files
committed
fix: Improve translation strings and update URL handling for published posts
1 parent 6f194fb commit 91f1909

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/wp-admin/includes/dashboard.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,24 @@ function wp_dashboard_right_now() {
309309
if ( $num_posts && $num_posts->publish ) {
310310
if ( 'post' === $post_type ) {
311311
/* translators: %s: Number of posts. */
312-
$text = _n( '%s Published post', '%s Published posts', $num_posts->publish );
312+
$text = _n( '%s Published Post', '%s Published Posts', $num_posts->publish );
313313
} else {
314314
/* translators: %s: Number of pages. */
315-
$text = _n( '%s Published page', '%s Published pages', $num_posts->publish );
315+
$text = _n( '%s Published Page', '%s Published Pages', $num_posts->publish );
316316
}
317317

318318
$text = sprintf( $text, number_format_i18n( $num_posts->publish ) );
319319
$post_type_object = get_post_type_object( $post_type );
320320

321321
if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) {
322-
printf( '<li class="%1$s-count"><a href="edit.php?post_status=publish&post_type=%1$s">%2$s</a></li>', $post_type, $text );
322+
$url = add_query_arg(
323+
array(
324+
'post_status' => 'publish',
325+
'post_type' => $post_type,
326+
),
327+
admin_url( 'edit.php' )
328+
);
329+
printf( '<li class="%1$s-count"><a href="%1$s">%2$s</a></li>', esc_url( $url ), esc_html( $text ) );
323330
} else {
324331
printf( '<li class="%1$s-count"><span>%2$s</span></li>', $post_type, $text );
325332
}

0 commit comments

Comments
 (0)