diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 2f37fbae50bbf..997546e93d65c 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -2786,6 +2786,12 @@ 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 ) { $calendar_output .= "\n\t\n\t\n\t\t"; @@ -2804,9 +2810,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 ),