<!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>[33155] trunk/src/wp-admin: List tables: Better accessibility and design for the comments bubble.</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/33155">33155</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/33155","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>helen</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-07-10 21:43:32 +0000 (Fri, 10 Jul 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'>List tables: Better accessibility and design for the comments bubble.
It is now plain text in the comments list table's "In Response To" column, where it was visually a bit confusing to have the bubble. For other list tables, it now shows a little notification bubble with the number of pending comments. The bubble and notification become plain text in the responsive list table view. It also shows no bubble when there are no comments at all, reducing some of the visual noise.
props picard102, afercia, karinchristen.
fixes <a href="https://core.trac.wordpress.org/ticket/32152">#32152</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincsslisttablescss">trunk/src/wp-admin/css/list-tables.css</a></li>
<li><a href="#trunksrcwpadminincludesclasswpcommentslisttablephp">trunk/src/wp-admin/includes/class-wp-comments-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswplisttablephp">trunk/src/wp-admin/includes/class-wp-list-table.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincsslisttablescss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/list-tables.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/list-tables.css 2015-07-10 21:32:23 UTC (rev 33154)
+++ trunk/src/wp-admin/css/list-tables.css 2015-07-10 21:43:32 UTC (rev 33155)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,79 +1,126 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/* List table styles */
-.post-com-count-wrapper {
- min-width: 22px;
-}
-
-.post-com-count {
- background: none;
- height: 1.3em;
- line-height: 1.1em;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.response-links {
</ins><span class="cx" style="display: block; padding: 0 10px"> display: block;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- text-decoration: none;
- padding: 0 0 6px;
- cursor: pointer;
- background-position: center -80px;
- background-repeat: no-repeat;
- color: #fff;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ margin-bottom: 1em;
</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">-.post-com-count:after { /* draw bubble connector using CSS! */
- content: "";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.response-links a {
</ins><span class="cx" style="display: block; padding: 0 10px"> display: block;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- width: 0;
- height: 0;
- margin-left: 8px;
- border-top: 5px solid #b4b9be;
- border-right: 5px solid transparent;
</del><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">-.post-com-count span {
- font-size: 11px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.response-links a.comments-edit-item-link {
</ins><span class="cx" style="display: block; padding: 0 10px"> font-weight: 600;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- height: 1.4em;
- line-height: 1.4em;
- min-width: 0.7em;
- padding: 0 6px;
- display: inline-block;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- background-color: #b4b9be;
- color: #fff;
</del><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">-.post-com-count:hover {
- background-position: center -3px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.response-links a.comments-view-item-link {
+ font-size: 12px;
</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">-.post-com-count:hover span {
- background-color: #00a0d2;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.column-response .post-com-count .screen-reader-text {
+ position: static;
+ width: auto;
+ height: auto;
+ margin: 0;
</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">-.post-com-count:hover:after {
- border-top: 5px solid #00a0d2;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.column-response .post-com-count [aria-hidden="true"] {
+ display: none;
</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">-strong .post-com-count {
- background-position: center -55px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.post-com-count-wrapper strong {
+ font-weight: 400;
</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">-strong .post-com-count span {
- background-color: #0073aa;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.column-response .post-com-count.post-com-count-pending {
+ color: #bb2a2a;
</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">-strong .post-com-count:after {
- border-top: 5px solid #0073aa;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.comments-view-item-link {
+ display: inline-block;
+ clear: both;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.column-comments .post-com-count-wrapper {
+ white-space: nowrap;
+ word-wrap: normal;
+}
+
+/* comments bubble common */
+.column-comments .post-com-count {
+ display: inline-block;
+ vertical-align: top;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .column-response .post-com-count {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- float: left;
- margin-right: 5px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ display: block;
+}
+
+/* comments bubble approved */
+.column-comments .post-com-count-no-comments,
+.column-comments .post-com-count-approved {
+ margin-top: 5px;
+}
+
+.column-comments .comment-count-no-comments,
+.column-comments .comment-count-approved {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ display: block;
+ padding: 0 8px;
+ min-width: 24px;
+ height: 2em;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ background-color: #72777c;
+ color: #fff;
+ font-size: 11px;
+ line-height: 21px;
</ins><span class="cx" style="display: block; padding: 0 10px"> text-align: center;
</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">-.response-links {
- float: left;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.ie8 .column-comments .comment-count-no-comments,
+.ie8 .column-comments .comment-count-approved {
+ min-width: 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.column-comments .post-com-count-no-comments:after,
+.column-comments .post-com-count-approved:after {
+ content: "";
+ display: block;
+ margin-left: 8px;
+ width: 0;
+ height: 0;
+ border-top: 5px solid #72777c;
+ border-right: 5px solid transparent;
+}
+
+.column-comments .post-com-count-approved:hover .comment-count-approved,
+.column-comments .post-com-count-approved:focus .comment-count-approved {
+ background: #0073aa;
+}
+
+.column-comments .post-com-count-approved:hover:after,
+.column-comments .post-com-count-approved:focus:after {
+ border-top-color: #0073aa;
+}
+
+/* comments bubble pending */
+.column-comments .post-com-count-pending {
+ position: relative;
+ left: -3px;
+ padding: 0 5px;
+ min-width: 7px;
+ height: 17px;
+ border: 2px solid #fff;
+ -webkit-border-radius: 11px;
+ border-radius: 11px;
+ background: #ca4a1f;
+ color: #fff;
+ font-size: 9px;
+ line-height: 17px;
+ text-align: center;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /* comments */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .commentlist li {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -283,7 +330,7 @@
</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"> .fixed .column-comments {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- width: 4em;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ width: 5.5em;
</ins><span class="cx" style="display: block; padding: 0 10px"> padding: 8px 0;
</span><span class="cx" style="display: block; padding: 0 10px"> text-align: left;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,9 +339,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> padding-left: 3px;
</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">-.fixed .column-comments a {
- float: left;
-}
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> td.column-title strong,
</span><span class="cx" style="display: block; padding: 0 10px"> td.plugin-title strong {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1452,14 +1496,6 @@
</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">-@media screen and ( max-width: 782px ) {
- .plugin-card {
- margin-left: 0;
- margin-right: 0;
- width: 100%;
- }
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> .plugin-card-top {
</span><span class="cx" style="display: block; padding: 0 10px"> position: relative;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 20px 20px 10px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1815,6 +1851,56 @@
</span><span class="cx" style="display: block; padding: 0 10px"> box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* Show comment bubble as text instead */
+ .post-com-count .screen-reader-text {
+ position: static;
+ width: auto;
+ height: auto;
+ margin: 0;
+ }
+
+ .column-comments .post-com-count-no-comments:after,
+ .column-comments .post-com-count-approved:after {
+ content: none;
+ }
+
+ .column-comments .post-com-count [aria-hidden="true"] {
+ display: none;
+ }
+
+ .column-comments .post-com-count-wrapper {
+ white-space: normal;
+ }
+
+ .column-comments .post-com-count-wrapper > a {
+ display: block;
+ }
+
+ .column-comments .post-com-count-no-comments,
+ .column-comments .post-com-count-approved {
+ margin-top: 0;
+ margin-right: 0.5em;
+ }
+
+ .column-comments .post-com-count-pending {
+ position: static;
+ height: auto;
+ min-width: 0;
+ padding: 0;
+ border: none;
+ -webkit-border-radius: 0;
+ border-radius: 0;
+ background: none;
+ color: #bb2a2a;
+ font-size: inherit;
+ line-height: inherit;
+ text-align: left;
+ }
+
+ .column-comments .post-com-count-pending:hover {
+ color: #dc3232;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .widefat thead .check-column, .widefat tfoot .check-column {
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 10px 0 10px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2020,4 +2106,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
</span><span class="cx" style="display: block; padding: 0 10px"> box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ .plugin-card {
+ margin-left: 0;
+ margin-right: 0;
+ width: 100%;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpcommentslisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-comments-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-comments-list-table.php 2015-07-10 21:32:23 UTC (rev 33154)
+++ trunk/src/wp-admin/includes/class-wp-comments-list-table.php 2015-07-10 21:43:32 UTC (rev 33155)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -678,21 +678,23 @@
</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"> if ( current_user_can( 'edit_post', $post->ID ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_link = "<a href='" . get_edit_post_link( $post->ID ) . "'>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_link = "<a href='" . get_edit_post_link( $post->ID ) . "' class='comments-edit-item-link'>";
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_link .= esc_html( get_the_title( $post->ID ) ) . '</a>';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_link = esc_html( get_the_title( $post->ID ) );
</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">- echo '<div class="response-links"><span class="post-com-count-wrapper">';
- echo $post_link . '<br />';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo '<div class="response-links">';
+ echo $post_link;
+ $post_type_object = get_post_type_object( $post->post_type );
+ echo "<a href='" . get_permalink( $post->ID ) . "' class='comments-view-item-link'>" . $post_type_object->labels->view_item . '</a>';
+ if ( 'attachment' == $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) ) {
+ echo $thumb;
+ }
+ echo '</div>';
+ echo '<span class="post-com-count-wrapper">';
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->comments_bubble( $post->ID, $pending_comments );
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</span> ';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_type_object = get_post_type_object( $post->post_type );
- echo "<a href='" . get_permalink( $post->ID ) . "'>" . $post_type_object->labels->view_item . '</a>';
- echo '</div>';
- if ( 'attachment' == $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) )
- echo $thumb;
</del><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>
<a id="trunksrcwpadminincludesclasswplisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-list-table.php 2015-07-10 21:32:23 UTC (rev 33154)
+++ trunk/src/wp-admin/includes/class-wp-list-table.php 2015-07-10 21:43:32 UTC (rev 33155)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -614,15 +614,41 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $pending_comments Number of pending comments.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function comments_bubble( $post_id, $pending_comments ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $approved_comments = get_comments_number();
</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 ( $pending_comments )
- echo '<strong>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $approved_comments_number = number_format_i18n( $approved_comments );
+ $pending_comments_number = number_format_i18n( $pending_comments );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<a href='" . esc_url( add_query_arg( 'p', $post_id, admin_url( 'edit-comments.php' ) ) ) . "' title='" . esc_attr( $pending_phrase ) . "' class='post-com-count'><span class='comment-count'>" . number_format_i18n( get_comments_number() ) . "</span></a>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $approved_only_phrase = sprintf( _n( '%s comment', '%s comments', $approved_comments ), $approved_comments_number );
+ $approved_phrase = sprintf( _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
+ $pending_phrase = sprintf( _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );
</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 ( $pending_comments )
- echo '</strong>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // No comments at all.
+ if ( ! $approved_comments && ! $pending_comments ) {
+ printf( '<span aria-hidden="true">—</span><span class="screen-reader-text">%s</span>',
+ __( 'No comments' )
+ );
+ // Approved comments have different display depending on some conditions.
+ } elseif ( $approved_comments ) {
+ printf( '<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
+ esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'approved' ), admin_url( 'edit-comments.php' ) ) ),
+ $approved_comments_number,
+ $pending_comments ? $approved_phrase : $approved_only_phrase
+ );
+ } else {
+ printf( '<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
+ $approved_comments_number,
+ $pending_comments ? __( 'No approved comments' ) : __( 'No comments' )
+ );
+ }
+
+ if ( $pending_comments ) {
+ printf( '<a href="%s" class="post-com-count post-com-count-pending"><span class="comment-count-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
+ esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'moderated' ), admin_url( 'edit-comments.php' ) ) ),
+ $pending_comments_number,
+ $pending_phrase
+ );
+ }
</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>