From 6ef9e399203b0567192318f1577edc5a2395f95c Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Sat, 19 Sep 2026 16:53:05 +0530 Subject: [PATCH 1/3] Fix translation lookups inside the loop --- src/wp-includes/general-template.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 2f37fbae50bbf..d75867e8a912a 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -2786,6 +2786,10 @@ function get_calendar( $args = array() ) { $newrow = false; $daysinmonth = (int) gmdate( 't', $unixmonth ); + /* translators: Post calendar label. %s: Date. */ + $posts_published_label = __( 'Posts published on %s' ); + $archive_date_format = _x( 'F j, Y', 'daily archives date format' ); + for ( $day = 1; $day <= $daysinmonth; ++$day ) { if ( $newrow ) { $calendar_output .= "\n\t\n\t\n\t\t"; @@ -2804,9 +2808,8 @@ function get_calendar( $args = array() ) { if ( in_array( $day, $daywithpost, true ) ) { // Any posts today? - $date_format = gmdate( _x( 'F j, Y', 'daily archives date format' ), strtotime( "{$thisyear}-{$thismonth}-{$day}" ) ); - /* translators: Post calendar label. %s: Date. */ - $label = sprintf( __( 'Posts published on %s' ), $date_format ); + $date_format = gmdate( $archive_date_format, strtotime( "{$thisyear}-{$thismonth}-{$day}" ) ); + $label = sprintf( $posts_published_label, $date_format ); $calendar_output .= sprintf( '%s', get_day_link( $thisyear, $thismonth, $day ), From 3338c823e613bdd0f778f52ea0c3d70535b8c4e7 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 21 Sep 2026 09:01:46 +0530 Subject: [PATCH 2/3] Add conditional for posts published label in calendar Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/wp-includes/general-template.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index d75867e8a912a..9095bf11f0bea 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -2786,9 +2786,11 @@ function get_calendar( $args = array() ) { $newrow = false; $daysinmonth = (int) gmdate( 't', $unixmonth ); +if ( $daywithpost ) { /* translators: Post calendar label. %s: Date. */ $posts_published_label = __( 'Posts published on %s' ); $archive_date_format = _x( 'F j, Y', 'daily archives date format' ); +} for ( $day = 1; $day <= $daysinmonth; ++$day ) { if ( $newrow ) { From 55d82f25de6e3c2e1cd45e50ace70fe84e9175aa Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 21 Sep 2026 09:02:40 +0530 Subject: [PATCH 3/3] Fix indentation for post calendar label logic --- src/wp-includes/general-template.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 9095bf11f0bea..997546e93d65c 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -2786,11 +2786,11 @@ function get_calendar( $args = array() ) { $newrow = false; $daysinmonth = (int) gmdate( 't', $unixmonth ); -if ( $daywithpost ) { - /* translators: Post calendar label. %s: Date. */ - $posts_published_label = __( 'Posts published on %s' ); - $archive_date_format = _x( 'F j, Y', 'daily archives date format' ); -} + if ( $daywithpost ) { + /* translators: Post calendar label. %s: Date. */ + $posts_published_label = __( 'Posts published on %s' ); + $archive_date_format = _x( 'F j, Y', 'daily archives date format' ); + } for ( $day = 1; $day <= $daysinmonth; ++$day ) { if ( $newrow ) {