<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[34463] trunk/src/wp-includes/general-template.php: Calendar Widget: remove the `title` attribute for days and replace with `aria-label`.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/34463">34463</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/34463","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-09-23 23:56:05 +0000 (Wed, 23 Sep 2015)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Calendar Widget: remove the `title` attribute for days and replace with `aria-label`. Spruce up some of this nasty code. Delete unnecessary bits.

Props wonderboymusic, elusiveunit, 5um17. 
Fixes <a href="https://core.trac.wordpress.org/ticket/30297">#30297</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesgeneraltemplatephp">trunk/src/wp-includes/general-template.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/general-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/general-template.php        2015-09-23 21:56:32 UTC (rev 34462)
+++ trunk/src/wp-includes/general-template.php  2015-09-23 23:56:05 UTC (rev 34463)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1611,64 +1611,69 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @param bool $echo    Optional, default is true. Set to false for return.
</span><span class="cx" style="display: block; padding: 0 10px">  * @return string|void String when retrieving.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_calendar($initial = true, $echo = true) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_calendar( $initial = true, $echo = true ) {
</ins><span class="cx" style="display: block; padding: 0 10px">         global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $key = md5( $m . $monthnum . $year );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) {
-               if ( is_array($cache) && isset( $cache[ $key ] ) ) {
-                       if ( $echo ) {
-                               /** This filter is documented in wp-includes/general-template.php */
-                               echo apply_filters( 'get_calendar', $cache[$key] );
-                               return;
-                       } else {
-                               /** This filter is documented in wp-includes/general-template.php */
-                               return apply_filters( 'get_calendar', $cache[$key] );
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $cache = wp_cache_get( 'get_calendar', 'calendar' );
+
+       if ( $cache && is_array( $cache ) && isset( $cache[ $key ] ) ) {
+               /** This filter is documented in wp-includes/general-template.php */
+               $output = apply_filters( 'get_calendar', $cache[ $key ] );
+
+               if ( $echo ) {
+                       echo $output;
+                       return;
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+               return $output;
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( !is_array($cache) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! is_array( $cache ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $cache = array();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Quick check. If we have no posts at all, abort!
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( !$posts ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $posts ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $gotsome = $wpdb->get_var("SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1");
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( !$gotsome ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! $gotsome ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $cache[ $key ] = '';
</span><span class="cx" style="display: block; padding: 0 10px">                        wp_cache_set( 'get_calendar', $cache, 'calendar' );
</span><span class="cx" style="display: block; padding: 0 10px">                        return;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( isset($_GET['w']) )
-               $w = ''.intval($_GET['w']);
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $_GET['w'] ) ) {
+               $w = (int) $_GET['w'];
+       }
</ins><span class="cx" style="display: block; padding: 0 10px">         // week_begins = 0 stands for Sunday
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $week_begins = intval(get_option('start_of_week'));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $week_begins = (int) get_option( 'start_of_week' );
+       $ts = current_time( 'timestamp' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Let's figure out when we are
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( !empty($monthnum) && !empty($year) ) {
-               $thismonth = ''.zeroise(intval($monthnum), 2);
-               $thisyear = ''.intval($year);
-       } elseif ( !empty($w) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $monthnum ) && ! empty( $year ) ) {
+               $thismonth = zeroise( intval( $monthnum ), 2 );
+               $thisyear = (int) $year;
+       } elseif ( ! empty( $w ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 // We need to get the month from MySQL
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $thisyear = ''.intval(substr($m, 0, 4));
-               $d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $thisyear = (int) substr( $m, 0, 4 );
+               //it seems MySQL's weeks disagree with PHP's
+               $d = ( ( $w - 1 ) * 7 ) + 6;
</ins><span class="cx" style="display: block; padding: 0 10px">                 $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')");
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        } elseif ( !empty($m) ) {
-               $thisyear = ''.intval(substr($m, 0, 4));
-               if ( strlen($m) < 6 )
-                               $thismonth = '01';
-               else
-                               $thismonth = ''.zeroise(intval(substr($m, 4, 2)), 2);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( ! empty( $m ) ) {
+               $thisyear = (int) substr( $m, 0, 4 );
+               if ( strlen( $m ) < 6 ) {
+                       $thismonth = '01';
+               } else {
+                       $thismonth = zeroise( (int) substr( $m, 4, 2 ), 2 );
+               }
</ins><span class="cx" style="display: block; padding: 0 10px">         } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $thisyear = gmdate('Y', current_time('timestamp'));
-               $thismonth = gmdate('m', current_time('timestamp'));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $thisyear = gmdate( 'Y', $ts );
+               $thismonth = gmdate( 'm', $ts );
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $unixmonth = mktime(0, 0 , 0, $thismonth, 1, $thisyear);
-       $last_day = date('t', $unixmonth);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $unixmonth = mktime( 0, 0 , 0, $thismonth, 1, $thisyear );
+       $last_day = date( 't', $unixmonth );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Get the next and previous month and year with at least one post
</span><span class="cx" style="display: block; padding: 0 10px">        $previous = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1687,19 +1692,23 @@
</span><span class="cx" style="display: block; padding: 0 10px">        /* translators: Calendar caption: 1: month name, 2: 4-digit year */
</span><span class="cx" style="display: block; padding: 0 10px">        $calendar_caption = _x('%1$s %2$s', 'calendar caption');
</span><span class="cx" style="display: block; padding: 0 10px">        $calendar_output = '<table id="wp-calendar">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <caption>' . sprintf($calendar_caption, $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . '</caption>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <caption>' . sprintf(
+               $calendar_caption,
+               $wp_locale->get_month( $thismonth ),
+               date( 'Y', $unixmonth )
+       ) . '</caption>
</ins><span class="cx" style="display: block; padding: 0 10px">         <thead>
</span><span class="cx" style="display: block; padding: 0 10px">        <tr>';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $myweek = array();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        for ( $wdcount=0; $wdcount<=6; $wdcount++ ) {
-               $myweek[] = $wp_locale->get_weekday(($wdcount+$week_begins)%7);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for ( $wdcount = 0; $wdcount <= 6; $wdcount++ ) {
+               $myweek[] = $wp_locale->get_weekday( ( $wdcount + $week_begins ) % 7 );
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        foreach ( $myweek as $wd ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $day_name = $initial ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd);
-               $wd = esc_attr($wd);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $day_name = $initial ? $wp_locale->get_weekday_initial( $wd ) : $wp_locale->get_weekday_abbrev( $wd );
+               $wd = esc_attr( $wd );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $calendar_output .= "\n\t\t<th scope=\"col\" title=\"$wd\">$day_name</th>";
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1711,7 +1720,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">        <tr>';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        if ( $previous ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link($previous->year, $previous->month) . '">&laquo; ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link( $previous->year, $previous->month ) . '">&laquo; ' .
+                       $wp_locale->get_month_abbrev( $wp_locale->get_month( $previous->month ) ) .
+               '</a></td>';
</ins><span class="cx" style="display: block; padding: 0 10px">         } else {
</span><span class="cx" style="display: block; padding: 0 10px">                $calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="pad">&nbsp;</td>';
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1719,7 +1730,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">        $calendar_output .= "\n\t\t".'<td class="pad">&nbsp;</td>';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        if ( $next ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $calendar_output .= "\n\t\t".'<td colspan="3" id="next"><a href="' . get_month_link($next->year, $next->month) . '">' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' &raquo;</a></td>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $calendar_output .= "\n\t\t".'<td colspan="3" id="next"><a href="' . get_month_link( $next->year, $next->month ) . '">' .
+                       $wp_locale->get_month_abbrev( $wp_locale->get_month( $next->month ) ) .
+               ' &raquo;</a></td>';
</ins><span class="cx" style="display: block; padding: 0 10px">         } else {
</span><span class="cx" style="display: block; padding: 0 10px">                $calendar_output .= "\n\t\t".'<td colspan="3" id="next" class="pad">&nbsp;</td>';
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1744,63 +1757,53 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'camino') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false)
-               $ak_title_separator = "\n";
-       else
-               $ak_title_separator = ', ';
-
-       $ak_titles_for_day = array();
-       $ak_post_titles = $wpdb->get_results("SELECT ID, post_title, DAYOFMONTH(post_date) as dom "
-               ."FROM $wpdb->posts "
-               ."WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' "
-               ."AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59' "
-               ."AND post_type = 'post' AND post_status = 'publish'"
-       );
-       if ( $ak_post_titles ) {
-               foreach ( (array) $ak_post_titles as $ak_post_title ) {
-
-                               /** This filter is documented in wp-includes/post-template.php */
-                               $post_title = esc_attr( apply_filters( 'the_title', $ak_post_title->post_title, $ak_post_title->ID ) );
-
-                               if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) )
-                                       $ak_titles_for_day['day_'.$ak_post_title->dom] = '';
-                               if ( empty($ak_titles_for_day["$ak_post_title->dom"]) ) // first one
-                                       $ak_titles_for_day["$ak_post_title->dom"] = $post_title;
-                               else
-                                       $ak_titles_for_day["$ak_post_title->dom"] .= $ak_title_separator . $post_title;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // See how much we should pad in the beginning
+       $pad = calendar_week_mod( date( 'w', $unixmonth ) - $week_begins );
+       if ( 0 != $pad ) {
+               $calendar_output .= "\n\t\t".'<td colspan="'. esc_attr( $pad ) .'" class="pad">&nbsp;</td>';
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        // See how much we should pad in the beginning
-       $pad = calendar_week_mod(date('w', $unixmonth)-$week_begins);
-       if ( 0 != $pad )
-               $calendar_output .= "\n\t\t".'<td colspan="'. esc_attr($pad) .'" class="pad">&nbsp;</td>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $newrow = false;
+       $daysinmonth = (int) date( 't', $unixmonth );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $daysinmonth = intval(date('t', $unixmonth));
</del><span class="cx" style="display: block; padding: 0 10px">         for ( $day = 1; $day <= $daysinmonth; ++$day ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( isset($newrow) && $newrow )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( isset($newrow) && $newrow ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $calendar_output .= "\n\t</tr>\n\t<tr>\n\t\t";
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                }
</ins><span class="cx" style="display: block; padding: 0 10px">                 $newrow = false;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( $day == gmdate('j', current_time('timestamp')) && $thismonth == gmdate('m', current_time('timestamp')) && $thisyear == gmdate('Y', current_time('timestamp')) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( $day == gmdate( 'j', $ts ) &&
+                       $thismonth == gmdate( 'm', $ts ) &&
+                       $thisyear == gmdate( 'Y', $ts ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $calendar_output .= '<td id="today">';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                else
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         } else {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $calendar_output .= '<td>';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( in_array($day, $daywithpost) ) // any posts today?
-                               $calendar_output .= '<a href="' . get_day_link( $thisyear, $thismonth, $day ) . '" title="' . esc_attr( $ak_titles_for_day[ $day ] ) . "\">$day</a>";
-               else
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( in_array( $day, $daywithpost ) ) {
+                       // any posts today?
+                       $date_format = date( _x( 'F j, Y', 'daily archives date format' ), strtotime( "{$thisyear}-{$thismonth}-{$day}" ) );
+                       $label = sprintf( __( 'Posts published on %s' ), $date_format );
+                       $calendar_output .= sprintf(
+                               '<a href="%s" aria-label="%s">%s</a>',
+                               get_day_link( $thisyear, $thismonth, $day ),
+                               esc_attr( $label ),
+                               $day
+                       );
+               } else {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $calendar_output .= $day;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                }
</ins><span class="cx" style="display: block; padding: 0 10px">                 $calendar_output .= '</td>';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( 6 == calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( 6 == calendar_week_mod( date( 'w', mktime(0, 0 , 0, $thismonth, $day, $thisyear ) ) - $week_begins ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $newrow = true;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                }
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $pad = 7 - calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins);
-       if ( $pad != 0 && $pad != 7 )
-               $calendar_output .= "\n\t\t".'<td class="pad" colspan="'. esc_attr($pad) .'">&nbsp;</td>';
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pad = 7 - calendar_week_mod( date( 'w', mktime( 0, 0 , 0, $thismonth, $day, $thisyear ) ) - $week_begins );
+       if ( $pad != 0 && $pad != 7 ) {
+               $calendar_output .= "\n\t\t".'<td class="pad" colspan="'. esc_attr( $pad ) .'">&nbsp;</td>';
+       }
</ins><span class="cx" style="display: block; padding: 0 10px">         $calendar_output .= "\n\t</tr>\n\t</tbody>\n\t</table>";
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $cache[ $key ] = $calendar_output;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1815,11 +1818,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param string $calendar_output HTML output of the calendar.
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                echo apply_filters( 'get_calendar', $calendar_output );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        } else {
-               /** This filter is documented in wp-includes/general-template.php */
-               return apply_filters( 'get_calendar', $calendar_output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return;
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** This filter is documented in wp-includes/general-template.php */
+       return apply_filters( 'get_calendar', $calendar_output );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre>
</div>
</div>

</body>
</html>