<!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>[54215] trunk: Administration: Add new `get_views_links` method to `WP_List_Table`.</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 { white-space: pre-line; 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/54215">54215</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/54215","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>davidbaumwald</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2022-09-19 21:06:08 +0000 (Mon, 19 Sep 2022)</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'>Administration: Add new `get_views_links` method to `WP_List_Table`.

Many `WP_List_Table` child classes in core use mostly the same code to create their "view" links markup.  To DRY-up the code, a new `WP_List_Table->get_view_links` method is being introduced to consolidate the HTML link generation when provided an array of links.

This change also implements this new method in the relevant `WP_List_Table_xxx` child classes `get_views` methods.  Finally, unit tests are being added to validate view links markup and test for some "unhappy paths".

Props afercia, costdev, garrett-eclipse, Dharm1025, juhise, peterwilsoncc.
Fixes <a href="https://core.trac.wordpress.org/ticket/42066">#42066</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<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>
<li><a href="#trunksrcwpadminincludesclasswpmssiteslisttablephp">trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpmsthemeslisttablephp">trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpmsuserslisttablephp">trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpplugininstalllisttablephp">trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswppluginslisttablephp">trunk/src/wp-admin/includes/class-wp-plugins-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswppostslisttablephp">trunk/src/wp-admin/includes/class-wp-posts-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpprivacyrequeststablephp">trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpthemeinstalllisttablephp">trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpuserslisttablephp">trunk/src/wp-admin/includes/class-wp-users-list-table.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpCommentsListTablephp">trunk/tests/phpunit/tests/admin/wpCommentsListTable.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpListTablephp">trunk/tests/phpunit/tests/admin/wpListTable.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpPostsListTablephp">trunk/tests/phpunit/tests/admin/wpPostsListTable.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpPrivacyRequestsTablephp">trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitewpMsSitesListTablephp">trunk/tests/phpunit/tests/multisite/wpMsSitesListTable.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestsadminwpPluginInstallListTablephp">trunk/tests/phpunit/tests/admin/wpPluginInstallListTable.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpPluginsListTablephp">trunk/tests/phpunit/tests/admin/wpPluginsListTable.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpPostCommentsListTablephp">trunk/tests/phpunit/tests/admin/wpPostCommentsListTable.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpThemeInstallListTablephp">trunk/tests/phpunit/tests/admin/wpThemeInstallListTable.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpUsersListTablephp">trunk/tests/phpunit/tests/admin/wpUsersListTable.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitewpMsThemesListTablephp">trunk/tests/phpunit/tests/multisite/wpMsThemesListTable.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitewpMsUsersListTablephp">trunk/tests/phpunit/tests/multisite/wpMsUsersListTable.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<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      2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/src/wp-admin/includes/class-wp-comments-list-table.php        2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -293,12 +293,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">                foreach ( $stati as $status => $label ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $current_link_attributes = '';
-
-                       if ( $status === $comment_status ) {
-                               $current_link_attributes = ' class="current" aria-current="page"';
-                       }
-
</del><span class="cx" style="display: block; padding: 0 10px">                         if ( 'mine' === $status ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $current_user_id    = get_current_user_id();
</span><span class="cx" style="display: block; padding: 0 10px">                                $num_comments->mine = get_comments(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -329,14 +323,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                $link = add_query_arg( 's', esc_attr( wp_unslash( $_REQUEST['s'] ) ), $link );
</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">-                        $status_links[ $status ] = "<a href='$link'$current_link_attributes>" . sprintf(
-                               translate_nooped_plural( $label, $num_comments->$status ),
-                               sprintf(
-                                       '<span class="%s-count">%s</span>',
-                                       ( 'moderated' === $status ) ? 'pending' : $status,
-                                       number_format_i18n( $num_comments->$status )
-                               )
-                       ) . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $status_links[ $status ] = array(
+                               'url'     => esc_url( $link ),
+                               'label'   => sprintf(
+                                       translate_nooped_plural( $label, $num_comments->$status ),
+                                       sprintf(
+                                               '<span class="%s-count">%s</span>',
+                                               ( 'moderated' === $status ) ? 'pending' : $status,
+                                               number_format_i18n( $num_comments->$status )
+                                       )
+                               ),
+                               'current' => $status === $comment_status,
+                       );
</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 class="lines" style="display: block; padding: 0 10px; color: #888">@@ -348,7 +346,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * @param string[] $status_links An associative array of fully-formed comment status links. Includes 'All', 'Mine',
</span><span class="cx" style="display: block; padding: 0 10px">                 *                              'Pending', 'Approved', 'Spam', and 'Trash'.
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return apply_filters( 'comment_status_links', $status_links );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return apply_filters( 'comment_status_links', $this->get_views_links( $status_links ) );
</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>
<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       2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/src/wp-admin/includes/class-wp-list-table.php 2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1514,6 +1514,78 @@
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Generates views links.
+        *
+        * @since 6.1.0
+        *
+        * @param array $link_data {
+        *     An array of link data.
+        *
+        *     @type string $url     The link URL.
+        *     @type string $label   The link label.
+        *     @type bool   $current Optional. Whether this is the currently selected view.
+        * }
+        * @return array An array of link markup. Keys match the $link_data input array.
+        */
+       protected function get_views_links( $link_data = array() ) {
+               if ( ! is_array( $link_data ) ) {
+                       _doing_it_wrong(
+                               __METHOD__,
+                               sprintf(
+                                       /* translators: %s: The $link_data argument. */
+                                       __( 'The <code>%s</code> argument must be an array.' ),
+                                       '$link_data'
+                               ),
+                               '6.1.0'
+                       );
+
+                       return array( '' );
+               }
+
+               $views_links = array();
+               foreach ( $link_data as $view => $link ) {
+                       if ( empty( $link['url'] ) || ! is_string( $link['url'] ) || '' === trim( $link['url'] ) ) {
+                               _doing_it_wrong(
+                                       __METHOD__,
+                                       sprintf(
+                                               /* translators: %1$s: The argument name. %2$s: The view name. */
+                                               __( 'The <code>%1$s</code> argument must be a non-empty string for <code>%2$s</code>.' ),
+                                               'url',
+                                               esc_html( $view )
+                                       ),
+                                       '6.1.0'
+                               );
+
+                               continue;
+                       }
+
+                       if ( empty( $link['label'] ) || ! is_string( $link['label'] ) || '' === trim( $link['label'] ) ) {
+                               _doing_it_wrong(
+                                       __METHOD__,
+                                       sprintf(
+                                               /* translators: %1$s: The argument name. %2$s: The view name. */
+                                               __( 'The <code>%1$s</code> argument must be a non-empty string for <code>%2$s</code>.' ),
+                                               'label',
+                                               esc_html( $view )
+                                       ),
+                                       '6.1.0'
+                               );
+
+                               continue;
+                       }
+
+                       $views_links[ $view ] = sprintf(
+                               '<a href="%s"%s>%s</a>',
+                               esc_url( $link['url'] ),
+                               isset( $link['current'] ) && true === $link['current'] ? ' class="current" aria-current="page"' : '',
+                               $link['label']
+                       );
+               }
+
+               return $views_links;
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Sends required variables to JavaScript land.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 3.1.0
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpmssiteslisttablephp"></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-ms-sites-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-ms-sites-list-table.php      2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php        2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -262,23 +262,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $url              = 'sites.php';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $statuses as $status => $label_count ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $current_link_attributes = $requested_status === $status || ( '' === $requested_status && 'all' === $status )
-                               ? ' class="current" aria-current="page"'
-                               : '';
</del><span class="cx" style="display: block; padding: 0 10px">                         if ( (int) $counts[ $status ] > 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $label    = sprintf( translate_nooped_plural( $label_count, $counts[ $status ] ), number_format_i18n( $counts[ $status ] ) );
</span><span class="cx" style="display: block; padding: 0 10px">                                $full_url = 'all' === $status ? $url : add_query_arg( 'status', $status, $url );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $view_links[ $status ] = sprintf(
-                                       '<a href="%1$s"%2$s>%3$s</a>',
-                                       esc_url( $full_url ),
-                                       $current_link_attributes,
-                                       $label
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $view_links[ $status ] = array(
+                                       'url'     => esc_url( $full_url ),
+                                       'label'   => $label,
+                                       'current' => $requested_status === $status || ( '' === $requested_status && 'all' === $status ),
</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 class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return $view_links;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $this->get_views_links( $view_links );
</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>
<a id="trunksrcwpadminincludesclasswpmsthemeslisttablephp"></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-ms-themes-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-ms-themes-list-table.php     2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php       2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -444,16 +444,15 @@
</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 ( 'search' !== $type ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $status_links[ $type ] = sprintf(
-                                       "<a href='%s'%s>%s</a>",
-                                       esc_url( add_query_arg( 'theme_status', $type, $url ) ),
-                                       ( $type === $status ) ? ' class="current" aria-current="page"' : '',
-                                       sprintf( $text, number_format_i18n( $count ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $status_links[ $type ] = array(
+                                       'url'     => esc_url( add_query_arg( 'theme_status', $type, $url ) ),
+                                       'label'   => sprintf( $text, number_format_i18n( $count ) ),
+                                       'current' => $type === $status,
</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 class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return $status_links;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $this->get_views_links( $status_links );
</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>
<a id="trunksrcwpadminincludesclasswpmsuserslisttablephp"></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-ms-users-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-ms-users-list-table.php      2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php        2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,13 +137,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $super_admins = get_super_admins();
</span><span class="cx" style="display: block; padding: 0 10px">                $total_admins = count( $super_admins );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $current_link_attributes = 'super' !== $role ? ' class="current" aria-current="page"' : '';
-               $role_links              = array();
-               $role_links['all']       = sprintf(
-                       '<a href="%s"%s>%s</a>',
-                       network_admin_url( 'users.php' ),
-                       $current_link_attributes,
-                       sprintf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $role_links        = array();
+               $role_links['all'] = array(
+                       'url'     => network_admin_url( 'users.php' ),
+                       'label'   => sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px">                                 /* translators: Number of users. */
</span><span class="cx" style="display: block; padding: 0 10px">                                _nx(
</span><span class="cx" style="display: block; padding: 0 10px">                                        'All <span class="count">(%s)</span>',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,14 +149,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        'users'
</span><span class="cx" style="display: block; padding: 0 10px">                                ),
</span><span class="cx" style="display: block; padding: 0 10px">                                number_format_i18n( $total_users )
</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">+                 ),
+                       'current' => 'super' !== $role,
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $current_link_attributes = 'super' === $role ? ' class="current" aria-current="page"' : '';
-               $role_links['super']     = sprintf(
-                       '<a href="%s"%s>%s</a>',
-                       network_admin_url( 'users.php?role=super' ),
-                       $current_link_attributes,
-                       sprintf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+               $role_links['super'] = array(
+                       'url'     => network_admin_url( 'users.php?role=super' ),
+                       'label'   => sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px">                                 /* translators: Number of users. */
</span><span class="cx" style="display: block; padding: 0 10px">                                _n(
</span><span class="cx" style="display: block; padding: 0 10px">                                        'Super Admin <span class="count">(%s)</span>',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,10 +163,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        $total_admins
</span><span class="cx" style="display: block; padding: 0 10px">                                ),
</span><span class="cx" style="display: block; padding: 0 10px">                                number_format_i18n( $total_admins )
</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">+                 ),
+                       'current' => 'super' === $role,
</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">-                return $role_links;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $this->get_views_links( $role_links );
</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>
<a id="trunksrcwpadminincludesclasswpplugininstalllisttablephp"></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-plugin-install-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-plugin-install-list-table.php        2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php  2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,14 +310,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $display_tabs = array();
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( (array) $tabs as $action => $text ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $current_link_attributes                     = ( $action === $tab ) ? ' class="current" aria-current="page"' : '';
-                       $href                                        = self_admin_url( 'plugin-install.php?tab=' . $action );
-                       $display_tabs[ 'plugin-install-' . $action ] = "<a href='$href'$current_link_attributes>$text</a>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $display_tabs[ 'plugin-install-' . $action ] = array(
+                               'url'     => self_admin_url( 'plugin-install.php?tab=' . $action ),
+                               'label'   => $text,
+                               'current' => $action === $tab,
+                       );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px">                // No longer a real tab.
</span><span class="cx" style="display: block; padding: 0 10px">                unset( $display_tabs['plugin-install-upload'] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return $display_tabs;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $this->get_views_links( $display_tabs );
</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>
<a id="trunksrcwpadminincludesclasswppluginslisttablephp"></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-plugins-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-plugins-list-table.php       2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/src/wp-admin/includes/class-wp-plugins-list-table.php 2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -576,16 +576,15 @@
</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 ( 'search' !== $type ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $status_links[ $type ] = sprintf(
-                                       "<a href='%s'%s>%s</a>",
-                                       add_query_arg( 'plugin_status', $type, 'plugins.php' ),
-                                       ( $type === $status ) ? ' class="current" aria-current="page"' : '',
-                                       sprintf( $text, number_format_i18n( $count ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $status_links[ $type ] = array(
+                                       'url'     => add_query_arg( 'plugin_status', $type, 'plugins.php' ),
+                                       'label'   => sprintf( $text, number_format_i18n( $count ) ),
+                                       'current' => $type === $status,
</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 class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return $status_links;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $this->get_views_links( $status_links );
</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>
<a id="trunksrcwpadminincludesclasswppostslisttablephp"></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-posts-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-posts-list-table.php 2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/src/wp-admin/includes/class-wp-posts-list-table.php   2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -331,16 +331,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                number_format_i18n( $this->user_posts_count )
</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">-                        $mine = $this->get_edit_link( $mine_args, $mine_inner_html, $class );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $mine = array(
+                               'url'     => esc_url( add_query_arg( $mine_args, 'edit.php' ) ),
+                               'label'   => $mine_inner_html,
+                               'current' => isset( $_GET['author'] ) && ( $current_user_id === (int) $_GET['author'] ),
+                       );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $all_args['all_posts'] = 1;
</span><span class="cx" style="display: block; padding: 0 10px">                        $class                 = '';
</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 ( empty( $class ) && ( $this->is_base_request() || isset( $_REQUEST['all_posts'] ) ) ) {
-                       $class = 'current';
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $all_inner_html = sprintf(
</span><span class="cx" style="display: block; padding: 0 10px">                        /* translators: %s: Number of posts. */
</span><span class="cx" style="display: block; padding: 0 10px">                        _nx(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -352,7 +352,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        number_format_i18n( $total_posts )
</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">-                $status_links['all'] = $this->get_edit_link( $all_args, $all_inner_html, $class );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $status_links['all'] = array(
+                       'url'     => esc_url( add_query_arg( $all_args, 'edit.php' ) ),
+                       'label'   => $all_inner_html,
+                       'current' => empty( $class ) && ( $this->is_base_request() || isset( $_REQUEST['all_posts'] ) ),
+               );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $mine ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $status_links['mine'] = $mine;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -381,7 +385,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                number_format_i18n( $num_posts->$status_name )
</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">-                        $status_links[ $status_name ] = $this->get_edit_link( $status_args, $status_label, $class );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $status_links[ $status_name ] = array(
+                               'url'     => esc_url( add_query_arg( $status_args, 'edit.php' ) ),
+                               'label'   => $status_label,
+                               'current' => isset( $_REQUEST['post_status'] ) && $status_name === $_REQUEST['post_status'],
+                       );
</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">                if ( ! empty( $this->sticky_posts_count ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,7 +412,11 @@
</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">                        $sticky_link = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                'sticky' => $this->get_edit_link( $sticky_args, $sticky_inner_html, $class ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         'sticky' => array(
+                                       'url'     => esc_url( add_query_arg( $sticky_args, 'edit.php' ) ),
+                                       'label'   => $sticky_inner_html,
+                                       'current' => ! empty( $_REQUEST['show_sticky'] ),
+                               ),
</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">                        // Sticky comes after Publish, or if not listed, after All.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -412,7 +424,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $status_links = array_merge( array_slice( $status_links, 0, $split ), $sticky_link, array_slice( $status_links, $split ) );
</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">-                return $status_links;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $this->get_views_links( $status_links );
</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>
<a id="trunksrcwpadminincludesclasswpprivacyrequeststablephp"></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-privacy-requests-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-privacy-requests-table.php   2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php     2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,8 +153,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                // Normalized admin URL.
</span><span class="cx" style="display: block; padding: 0 10px">                $admin_url = $this->get_admin_url();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $current_link_attributes = empty( $current_status ) ? ' class="current" aria-current="page"' : '';
-               $status_label            = sprintf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $status_label = sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px">                         /* translators: %s: Number of requests. */
</span><span class="cx" style="display: block; padding: 0 10px">                        _nx(
</span><span class="cx" style="display: block; padding: 0 10px">                                'All <span class="count">(%s)</span>',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,11 +164,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        number_format_i18n( $total_requests )
</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">-                $views['all'] = sprintf(
-                       '<a href="%s"%s>%s</a>',
-                       esc_url( $admin_url ),
-                       $current_link_attributes,
-                       $status_label
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $views['all'] = array(
+                       'url'     => esc_url( $admin_url ),
+                       'label'   => $status_label,
+                       'current' => empty( $current_status ),
</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 ( $statuses as $status => $label ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -178,8 +176,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                continue;
</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">-                        $current_link_attributes = $status === $current_status ? ' class="current" aria-current="page"' : '';
-                       $total_status_requests   = absint( $counts->{$status} );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $total_status_requests = absint( $counts->{$status} );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( ! $total_status_requests ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                continue;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -192,15 +189,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $status_link = add_query_arg( 'filter-status', $status, $admin_url );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $views[ $status ] = sprintf(
-                               '<a href="%s"%s>%s</a>',
-                               esc_url( $status_link ),
-                               $current_link_attributes,
-                               $status_label
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $views[ $status ] = array(
+                               'url'     => esc_url( $status_link ),
+                               'label'   => $status_label,
+                               'current' => $status === $current_status,
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return $views;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $this->get_views_links( $views );
</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>
<a id="trunksrcwpadminincludesclasswpthemeinstalllisttablephp"></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-theme-install-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-theme-install-list-table.php 2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php   2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,12 +186,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $display_tabs = array();
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( (array) $tabs as $action => $text ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $current_link_attributes                    = ( $action === $tab ) ? ' class="current" aria-current="page"' : '';
-                       $href                                       = self_admin_url( 'theme-install.php?tab=' . $action );
-                       $display_tabs[ 'theme-install-' . $action ] = "<a href='$href'$current_link_attributes>$text</a>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $display_tabs[ 'theme-install-' . $action ] = array(
+                               'url'     => self_admin_url( 'theme-install.php?tab=' . $action ),
+                               'label'   => $text,
+                               'current' => $action === $tab,
+                       );
</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">-                return $display_tabs;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $this->get_views_links( $display_tabs );
</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>
<a id="trunksrcwpadminincludesclasswpuserslisttablephp"></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-users-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-users-list-table.php 2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/src/wp-admin/includes/class-wp-users-list-table.php   2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,10 +185,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $url = 'users.php';
</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">-                $role_links              = array();
-               $avail_roles             = array();
-               $all_text                = __( 'All' );
-               $current_link_attributes = empty( $role ) ? ' class="current" aria-current="page"' : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $role_links  = array();
+               $avail_roles = array();
+               $all_text    = __( 'All' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $count_users ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( $this->is_site_users ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -215,7 +214,11 @@
</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">-                $role_links['all'] = sprintf( '<a href="%s"%s>%s</a>', $url, $current_link_attributes, $all_text );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $role_links['all'] = array(
+                       'url'     => $url,
+                       'label'   => $all_text,
+                       'current' => empty( $role ),
+               );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $wp_roles->get_names() as $this_role => $name ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( $count_users && ! isset( $avail_roles[ $this_role ] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,12 +225,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                continue;
</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">-                        $current_link_attributes = '';
-
-                       if ( $this_role === $role ) {
-                               $current_link_attributes = ' class="current" aria-current="page"';
-                       }
-
</del><span class="cx" style="display: block; padding: 0 10px">                         $name = translate_user_role( $name );
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( $count_users ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $name = sprintf(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -238,17 +235,15 @@
</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">-                        $role_links[ $this_role ] = "<a href='" . esc_url( add_query_arg( 'role', $this_role, $url ) ) . "'$current_link_attributes>$name</a>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $role_links[ $this_role ] = array(
+                               'url'     => esc_url( add_query_arg( 'role', $this_role, $url ) ),
+                               'label'   => $name,
+                               'current' => $this_role === $role,
+                       );
</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">                if ( ! empty( $avail_roles['none'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $current_link_attributes = '';
-
-                       if ( 'none' === $role ) {
-                               $current_link_attributes = ' class="current" aria-current="page"';
-                       }
-
</del><span class="cx" style="display: block; padding: 0 10px">                         $name = __( 'No role' );
</span><span class="cx" style="display: block; padding: 0 10px">                        $name = sprintf(
</span><span class="cx" style="display: block; padding: 0 10px">                                /* translators: 1: User role name, 2: Number of users. */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -257,10 +252,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                number_format_i18n( $avail_roles['none'] )
</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">-                        $role_links['none'] = "<a href='" . esc_url( add_query_arg( 'role', 'none', $url ) ) . "'$current_link_attributes>$name</a>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $role_links['none'] = array(
+                               'url'     => esc_url( add_query_arg( 'role', 'none', $url ) ),
+                               'label'   => $name,
+                               'current' => 'none' === $role,
+                       );
</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">-                return $role_links;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $this->get_views_links( $role_links );
</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>
<a id="trunktestsphpunittestsadminwpCommentsListTablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/wpCommentsListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpCommentsListTable.php   2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/tests/phpunit/tests/admin/wpCommentsListTable.php     2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -195,4 +195,23 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertStringContainsString( 'column-date sorted desc', $output, 'Mismatch of CSS classes for the comment date column.' );
</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">+        /**
+        * @ticket 42066
+        *
+        * @covers WP_Comments_List_Table::get_views
+        */
+       public function test_get_views_should_return_views_by_default() {
+               $this->table->prepare_items();
+
+               $expected = array(
+                       'all'       => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=all" class="current" aria-current="page">All <span class="count">(<span class="all-count">0</span>)</span></a>',
+                       'mine'      => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=mine&#038;user_id=0">Mine <span class="count">(<span class="mine-count">0</span>)</span></a>',
+                       'moderated' => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=moderated">Pending <span class="count">(<span class="pending-count">0</span>)</span></a>',
+                       'approved'  => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=approved">Approved <span class="count">(<span class="approved-count">0</span>)</span></a>',
+                       'spam'      => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=spam">Spam <span class="count">(<span class="spam-count">0</span>)</span></a>',
+                       'trash'     => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=trash">Trash <span class="count">(<span class="trash-count">0</span>)</span></a>',
+               );
+               $this->assertSame( $expected, $this->table->get_views() );
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsadminwpListTablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/wpListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpListTable.php   2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/tests/phpunit/tests/admin/wpListTable.php     2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,6 +8,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Admin_WpListTable extends WP_UnitTestCase {
</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">+         * List table.
+        *
+        * @var WP_List_Table $list_table
+        */
+       protected static $list_table;
+
+       public static function set_up_before_class() {
+               global $hook_suffix;
+
+               parent::set_up_before_class();
+
+               require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
+
+               $hook_suffix      = '_wp_tests';
+               self::$list_table = new WP_List_Table();
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Tests that `WP_List_Table::get_column_info()` only adds the primary
</span><span class="cx" style="display: block; padding: 0 10px">         * column header when necessary.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,4 +122,226 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                return $datasets;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+       /**
+        * Tests the "get_views_links()" method.
+        *
+        * @ticket 42066
+        *
+        * @covers WP_List_Table::get_views_links
+        *
+        * @dataProvider data_get_views_links
+        *
+        * @param array $link_data {
+        *     An array of link data.
+        *
+        *     @type string $url     The link URL.
+        *     @type string $label   The link label.
+        *     @type bool   $current Optional. Whether this is the currently selected view.
+        * }
+        * @param array $expected
+        */
+       public function test_get_views_links( $link_data, $expected ) {
+               $get_views_links = new ReflectionMethod( self::$list_table, 'get_views_links' );
+               $get_views_links->setAccessible( true );
+
+               $actual = $get_views_links->invokeArgs( self::$list_table, array( $link_data ) );
+
+               $this->assertSameSetsWithIndex( $expected, $actual );
+       }
+
+       /**
+        * Data provider.
+        *
+        * @return array
+        */
+       public function data_get_views_links() {
+               return array(
+                       'one "current" link'                           => array(
+                               'link_data' => array(
+                                       'all'       => array(
+                                               'url'     => 'https://example.org/',
+                                               'label'   => 'All',
+                                               'current' => true,
+                                       ),
+                                       'activated' => array(
+                                               'url'     => add_query_arg( 'status', 'activated', 'https://example.org/' ),
+                                               'label'   => 'Activated',
+                                               'current' => false,
+                                       ),
+                               ),
+                               'expected'  => array(
+                                       'all'       => '<a href="https://example.org/" class="current" aria-current="page">All</a>',
+                                       'activated' => '<a href="https://example.org/?status=activated">Activated</a>',
+                               ),
+                       ),
+                       'two "current" links'                          => array(
+                               'link_data' => array(
+                                       'all'       => array(
+                                               'url'     => 'https://example.org/',
+                                               'label'   => 'All',
+                                               'current' => true,
+                                       ),
+                                       'activated' => array(
+                                               'url'     => add_query_arg( 'status', 'activated', 'https://example.org/' ),
+                                               'label'   => 'Activated',
+                                               'current' => true,
+                                       ),
+                               ),
+                               'expected'  => array(
+                                       'all'       => '<a href="https://example.org/" class="current" aria-current="page">All</a>',
+                                       'activated' => '<a href="https://example.org/?status=activated" class="current" aria-current="page">Activated</a>',
+                               ),
+                       ),
+                       'one "current" link and one without "current" key' => array(
+                               'link_data' => array(
+                                       'all'       => array(
+                                               'url'     => 'https://example.org/',
+                                               'label'   => 'All',
+                                               'current' => true,
+                                       ),
+                                       'activated' => array(
+                                               'url'   => add_query_arg( 'status', 'activated', 'https://example.org/' ),
+                                               'label' => 'Activated',
+                                       ),
+                               ),
+                               'expected'  => array(
+                                       'all'       => '<a href="https://example.org/" class="current" aria-current="page">All</a>',
+                                       'activated' => '<a href="https://example.org/?status=activated">Activated</a>',
+                               ),
+                       ),
+                       'one "current" link with escapable characters' => array(
+                               'link_data' => array(
+                                       'all'       => array(
+                                               'url'     => 'https://example.org/',
+                                               'label'   => 'All',
+                                               'current' => true,
+                                       ),
+                                       'activated' => array(
+                                               'url'     => add_query_arg(
+                                                       array(
+                                                               'status' => 'activated',
+                                                               'sort'   => 'desc',
+                                                       ),
+                                                       'https://example.org/'
+                                               ),
+                                               'label'   => 'Activated',
+                                               'current' => false,
+                                       ),
+                               ),
+                               'expected'  => array(
+                                       'all'       => '<a href="https://example.org/" class="current" aria-current="page">All</a>',
+                                       'activated' => '<a href="https://example.org/?status=activated&#038;sort=desc">Activated</a>',
+                               ),
+                       ),
+               );
+       }
+
+       /**
+        * Tests that "get_views_links()" throws a _doing_it_wrong().
+        *
+        * @ticket 42066
+        *
+        * @covers WP_List_Table::get_views_links
+        *
+        * @expectedIncorrectUsage WP_List_Table::get_views_links
+        *
+        * @dataProvider data_get_views_links_doing_it_wrong
+        *
+        * @param array $link_data {
+        *     An array of link data.
+        *
+        *     @type string $url     The link URL.
+        *     @type string $label   The link label.
+        *     @type bool   $current Optional. Whether this is the currently selected view.
+        * }
+        */
+       public function test_get_views_links_doing_it_wrong( $link_data ) {
+               $get_views_links = new ReflectionMethod( self::$list_table, 'get_views_links' );
+               $get_views_links->setAccessible( true );
+               $get_views_links->invokeArgs( self::$list_table, array( $link_data ) );
+       }
+
+       /**
+        * Data provider.
+        *
+        * @return array
+        */
+       public function data_get_views_links_doing_it_wrong() {
+               return array(
+                       'non-array $link_data'               => array(
+                               'link_data' => 'https://example.org, All, class="current" aria-current="page"',
+                       ),
+                       'a link with no URL'                 => array(
+                               'link_data' => array(
+                                       'all' => array(
+                                               'label'   => 'All',
+                                               'current' => true,
+                                       ),
+                               ),
+                       ),
+                       'a link with an empty URL'           => array(
+                               'link_data' => array(
+                                       'all' => array(
+                                               'url'     => '',
+                                               'label'   => 'All',
+                                               'current' => true,
+                                       ),
+                               ),
+                       ),
+                       'a link with a URL of only spaces'   => array(
+                               'link_data' => array(
+                                       'all' => array(
+                                               'url'     => '  ',
+                                               'label'   => 'All',
+                                               'current' => true,
+                                       ),
+                               ),
+                       ),
+                       'a link with a non-string URL'       => array(
+                               'link_data' => array(
+                                       'all' => array(
+                                               'url'     => array(),
+                                               'label'   => 'All',
+                                               'current' => true,
+                                       ),
+                               ),
+                       ),
+                       'a link with no label'               => array(
+                               'link_data' => array(
+                                       'all' => array(
+                                               'url'     => 'https://example.org/',
+                                               'current' => true,
+                                       ),
+                               ),
+                       ),
+                       'a link with an empty label'         => array(
+                               'link_data' => array(
+                                       'all' => array(
+                                               'url'     => 'https://example.org/',
+                                               'label'   => '',
+                                               'current' => true,
+                                       ),
+                               ),
+                       ),
+                       'a link with a label of only spaces' => array(
+                               'link_data' => array(
+                                       'all' => array(
+                                               'url'     => 'https://example.org/',
+                                               'label'   => '  ',
+                                               'current' => true,
+                                       ),
+                               ),
+                       ),
+                       'a link with a non-string label'     => array(
+                               'link_data' => array(
+                                       'all' => array(
+                                               'url'     => 'https://example.org/',
+                                               'label'   => array(),
+                                               'current' => true,
+                                       ),
+                               ),
+                       ),
+               );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsadminwpPluginInstallListTablephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/admin/wpPluginInstallListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpPluginInstallListTable.php                              (rev 0)
+++ trunk/tests/phpunit/tests/admin/wpPluginInstallListTable.php        2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,27 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group admin
+ *
+ * @covers WP_Plugin_Install_List_Table
+ */
+class Tests_Admin_wpPluginInstallListTable extends WP_UnitTestCase {
+       /**
+        * @var WP_Plugin_Install_List_Table
+        */
+       public $table = false;
+
+       public function set_up() {
+               parent::set_up();
+               $this->table = _get_list_table( 'WP_Plugin_Install_List_Table', array( 'screen' => 'plugin-install' ) );
+       }
+
+       /**
+        * @ticket 42066
+        *
+        * @covers WP_Plugin_Install_List_Table::get_views
+        */
+       public function test_get_views_should_return_no_views_by_default() {
+               $this->assertSame( array(), $this->table->get_views() );
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/admin/wpPluginInstallListTable.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsadminwpPluginsListTablephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/admin/wpPluginsListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpPluginsListTable.php                            (rev 0)
+++ trunk/tests/phpunit/tests/admin/wpPluginsListTable.php      2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,59 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group admin
+ *
+ * @covers WP_Plugins_List_Table
+ */
+class Tests_Admin_wpPluginsListTable extends WP_UnitTestCase {
+       /**
+        * @var WP_Plugins_List_Table
+        */
+       public $table = false;
+
+       public function set_up() {
+               parent::set_up();
+               $this->table = _get_list_table( 'WP_Plugins_List_Table', array( 'screen' => 'plugins' ) );
+       }
+
+       /**
+        * @ticket 42066
+        *
+        * @covers WP_Plugins_List_Table::get_views
+        */
+       public function test_get_views_should_return_views_by_default() {
+               global $totals;
+
+               $totals_backup = $totals;
+               $totals        = array(
+                       'all'                  => 45,
+                       'active'               => 1,
+                       'recently_activated'   => 2,
+                       'inactive'             => 3,
+                       'mustuse'              => 4,
+                       'dropins'              => 5,
+                       'paused'               => 6,
+                       'upgrade'              => 7,
+                       'auto-update-enabled'  => 8,
+                       'auto-update-disabled' => 9,
+               );
+
+               $expected = array(
+                       'all'                  => '<a href="plugins.php?plugin_status=all" class="current" aria-current="page">All <span class="count">(45)</span></a>',
+                       'active'               => '<a href="plugins.php?plugin_status=active">Active <span class="count">(1)</span></a>',
+                       'recently_activated'   => '<a href="plugins.php?plugin_status=recently_activated">Recently Active <span class="count">(2)</span></a>',
+                       'inactive'             => '<a href="plugins.php?plugin_status=inactive">Inactive <span class="count">(3)</span></a>',
+                       'mustuse'              => '<a href="plugins.php?plugin_status=mustuse">Must-Use <span class="count">(4)</span></a>',
+                       'dropins'              => '<a href="plugins.php?plugin_status=dropins">Drop-ins <span class="count">(5)</span></a>',
+                       'paused'               => '<a href="plugins.php?plugin_status=paused">Paused <span class="count">(6)</span></a>',
+                       'upgrade'              => '<a href="plugins.php?plugin_status=upgrade">Update Available <span class="count">(7)</span></a>',
+                       'auto-update-enabled'  => '<a href="plugins.php?plugin_status=auto-update-enabled">Auto-updates Enabled <span class="count">(8)</span></a>',
+                       'auto-update-disabled' => '<a href="plugins.php?plugin_status=auto-update-disabled">Auto-updates Disabled <span class="count">(9)</span></a>',
+               );
+
+               $actual = $this->table->get_views();
+               $totals = $totals_backup;
+
+               $this->assertSame( $expected, $actual );
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/admin/wpPluginsListTable.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsadminwpPostCommentsListTablephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/admin/wpPostCommentsListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpPostCommentsListTable.php                               (rev 0)
+++ trunk/tests/phpunit/tests/admin/wpPostCommentsListTable.php 2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,39 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group admin
+ *
+ * @covers WP_Post_Comments_List_Table
+ */
+class Tests_Admin_wpPostCommentsListTable extends WP_UnitTestCase {
+
+       /**
+        * @var WP_Post_Comments_List_Table
+        */
+       protected $table;
+
+       function set_up() {
+               parent::set_up();
+               $this->table = _get_list_table( 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-post-comments' ) );
+       }
+
+       /**
+        * @ticket 42066
+        *
+        * @covers WP_Post_Comments_List_Table::get_views
+        */
+       public function test_get_views_should_return_views_by_default() {
+               $this->table->prepare_items();
+
+               $expected = array(
+                       'all'       => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=all" class="current" aria-current="page">All <span class="count">(<span class="all-count">0</span>)</span></a>',
+                       'mine'      => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=mine&#038;user_id=0">Mine <span class="count">(<span class="mine-count">0</span>)</span></a>',
+                       'moderated' => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=moderated">Pending <span class="count">(<span class="pending-count">0</span>)</span></a>',
+                       'approved'  => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=approved">Approved <span class="count">(<span class="approved-count">0</span>)</span></a>',
+                       'spam'      => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=spam">Spam <span class="count">(<span class="spam-count">0</span>)</span></a>',
+                       'trash'     => '<a href="http://example.org/wp-admin/edit-comments.php?comment_status=trash">Trash <span class="count">(<span class="trash-count">0</span>)</span></a>',
+               );
+               $this->assertSame( $expected, $this->table->get_views() );
+       }
+
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/admin/wpPostCommentsListTable.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsadminwpPostsListTablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/wpPostsListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpPostsListTable.php      2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/tests/phpunit/tests/admin/wpPostsListTable.php        2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -319,4 +319,26 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertStringNotContainsString( 'id="delete_all"', $output );
</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">+        /**
+        * @ticket 42066
+        *
+        * @covers WP_Posts_List_Table::get_views
+        */
+       public function test_get_views_should_return_views_by_default() {
+               global $avail_post_stati;
+
+               $avail_post_stati_backup = $avail_post_stati;
+               $avail_post_stati        = get_available_post_statuses();
+
+               $actual           = $this->table->get_views();
+               $avail_post_stati = $avail_post_stati_backup;
+
+               $expected = array(
+                       'all'     => '<a href="edit.php?post_type=page">All <span class="count">(38)</span></a>',
+                       'publish' => '<a href="edit.php?post_status=publish&#038;post_type=page">Published <span class="count">(38)</span></a>',
+               );
+
+               $this->assertSame( $expected, $actual );
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsadminwpPrivacyRequestsTablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php        2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php  2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,4 +198,17 @@
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+       /**
+        * @ticket 42066
+        *
+        * @covers WP_Privacy_Requests_List_Table::get_views
+        */
+       public function test_get_views_should_return_views_by_default() {
+               $expected = array(
+                       'all' => '<a href="http://example.org/wp-admin/export-personal-data.php" class="current" aria-current="page">All <span class="count">(0)</span></a>',
+               );
+
+               $this->assertSame( $expected, $this->get_mocked_class_instance()->get_views() );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsadminwpThemeInstallListTablephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/admin/wpThemeInstallListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpThemeInstallListTable.php                               (rev 0)
+++ trunk/tests/phpunit/tests/admin/wpThemeInstallListTable.php 2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,27 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group admin
+ *
+ * @covers WP_Theme_Install_List_Table
+ */
+class Tests_Admin_wpThemeInstallListTable extends WP_UnitTestCase {
+       /**
+        * @var WP_Theme_Install_List_Table
+        */
+       public $table = false;
+
+       public function set_up() {
+               parent::set_up();
+               $this->table = _get_list_table( 'WP_Theme_Install_List_Table', array( 'screen' => 'theme-install' ) );
+       }
+
+       /**
+        * @ticket 42066
+        *
+        * @covers WP_Theme_Install_List_Table::get_views
+        */
+       public function test_get_views_should_return_no_views_by_default() {
+               $this->assertSame( array(), $this->table->get_views() );
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/admin/wpThemeInstallListTable.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsadminwpUsersListTablephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/admin/wpUsersListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpUsersListTable.php                              (rev 0)
+++ trunk/tests/phpunit/tests/admin/wpUsersListTable.php        2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,32 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group admin
+ *
+ * @covers WP_Users_List_Table
+ */
+class Tests_Admin_wpUsersListTable extends WP_UnitTestCase {
+       /**
+        * @var WP_Users_List_Table
+        */
+       public $table = false;
+
+       public function set_up() {
+               parent::set_up();
+               $this->table = _get_list_table( 'WP_Users_List_Table', array( 'screen' => 'users' ) );
+       }
+
+       /**
+        * @ticket 42066
+        *
+        * @covers WP_Users_List_Table::get_views
+        */
+       public function test_get_views_should_return_views_by_default() {
+               $expected = array(
+                       'all'           => '<a href="users.php" class="current" aria-current="page">All <span class="count">(1)</span></a>',
+                       'administrator' => '<a href="users.php?role=administrator">Administrator <span class="count">(1)</span></a>',
+               );
+
+               $this->assertSame( $expected, $this->table->get_views() );
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/admin/wpUsersListTable.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsmultisitewpMsSitesListTablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/multisite/wpMsSitesListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/wpMsSitesListTable.php        2022-09-19 20:54:20 UTC (rev 54214)
+++ trunk/tests/phpunit/tests/multisite/wpMsSitesListTable.php  2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -230,5 +230,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->assertSameSets( $expected, $items );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+               /**
+                * @ticket 42066
+                */
+               public function test_get_views_should_return_views_by_default() {
+                       $expected = array(
+                               'all'    => '<a href="sites.php" class="current" aria-current="page">All <span class="count">(14)</span></a>',
+                               'public' => '<a href="sites.php?status=public">Public <span class="count">(14)</span></a>',
+                       );
+
+                       $this->assertSame( $expected, $this->table->get_views() );
+               }
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> endif;
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitewpMsThemesListTablephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/multisite/wpMsThemesListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/wpMsThemesListTable.php                               (rev 0)
+++ trunk/tests/phpunit/tests/multisite/wpMsThemesListTable.php 2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,125 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group ms-required
+ * @group admin
+ * @group network-admin
+ *
+ * @covers WP_MS_Themes_List_Table
+ */
+class Tests_Multisite_wpMsThemesListTable extends WP_UnitTestCase {
+       protected static $site_ids;
+
+       /**
+        * @var WP_MS_Themes_List_Table
+        */
+       public $table = false;
+
+       public function set_up() {
+               parent::set_up();
+               $this->table = _get_list_table( 'WP_MS_Themes_List_Table', array( 'screen' => 'ms-themes' ) );
+       }
+
+       public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
+               self::$site_ids = array(
+                       'wordpress.org/'          => array(
+                               'domain' => 'wordpress.org',
+                               'path'   => '/',
+                       ),
+                       'wordpress.org/foo/'      => array(
+                               'domain' => 'wordpress.org',
+                               'path'   => '/foo/',
+                       ),
+                       'wordpress.org/foo/bar/'  => array(
+                               'domain' => 'wordpress.org',
+                               'path'   => '/foo/bar/',
+                       ),
+                       'wordpress.org/afoo/'     => array(
+                               'domain' => 'wordpress.org',
+                               'path'   => '/afoo/',
+                       ),
+                       'make.wordpress.org/'     => array(
+                               'domain' => 'make.wordpress.org',
+                               'path'   => '/',
+                       ),
+                       'make.wordpress.org/foo/' => array(
+                               'domain' => 'make.wordpress.org',
+                               'path'   => '/foo/',
+                       ),
+                       'www.w.org/'              => array(
+                               'domain' => 'www.w.org',
+                               'path'   => '/',
+                       ),
+                       'www.w.org/foo/'          => array(
+                               'domain' => 'www.w.org',
+                               'path'   => '/foo/',
+                       ),
+                       'www.w.org/foo/bar/'      => array(
+                               'domain' => 'www.w.org',
+                               'path'   => '/foo/bar/',
+                       ),
+                       'test.example.org/'       => array(
+                               'domain' => 'test.example.org',
+                               'path'   => '/',
+                       ),
+                       'test2.example.org/'      => array(
+                               'domain' => 'test2.example.org',
+                               'path'   => '/',
+                       ),
+                       'test3.example.org/zig/'  => array(
+                               'domain' => 'test3.example.org',
+                               'path'   => '/zig/',
+                       ),
+                       'atest.example.org/'      => array(
+                               'domain' => 'atest.example.org',
+                               'path'   => '/',
+                       ),
+               );
+
+               foreach ( self::$site_ids as &$id ) {
+                       $id = $factory->blog->create( $id );
+               }
+               unset( $id );
+       }
+
+       public static function wpTearDownAfterClass() {
+               foreach ( self::$site_ids as $site_id ) {
+                       wp_delete_site( $site_id );
+               }
+       }
+
+       /**
+        * @ticket 42066
+        *
+        * @covers WP_MS_Themes_List_Table::get_views
+        */
+       public function test_get_views_should_return_views_by_default() {
+               global $totals;
+
+               $totals_backup = $totals;
+               $totals        = array(
+                       'all'                  => 21,
+                       'enabled'              => 1,
+                       'disabled'             => 2,
+                       'upgrade'              => 3,
+                       'broken'               => 4,
+                       'auto-update-enabled'  => 5,
+                       'auto-update-disabled' => 6,
+               );
+
+               $expected = array(
+                       'all'                  => '<a href="themes.php?theme_status=all" class="current" aria-current="page">All <span class="count">(21)</span></a>',
+                       'enabled'              => '<a href="themes.php?theme_status=enabled">Enabled <span class="count">(1)</span></a>',
+                       'disabled'             => '<a href="themes.php?theme_status=disabled">Disabled <span class="count">(2)</span></a>',
+                       'upgrade'              => '<a href="themes.php?theme_status=upgrade">Update Available <span class="count">(3)</span></a>',
+                       'broken'               => '<a href="themes.php?theme_status=broken">Broken <span class="count">(4)</span></a>',
+                       'auto-update-enabled'  => '<a href="themes.php?theme_status=auto-update-enabled">Auto-updates Enabled <span class="count">(5)</span></a>',
+                       'auto-update-disabled' => '<a href="themes.php?theme_status=auto-update-disabled">Auto-updates Disabled <span class="count">(6)</span></a>',
+               );
+
+               $actual = $this->table->get_views();
+               $totals = $totals_backup;
+
+               $this->assertSame( $expected, $actual );
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/multisite/wpMsThemesListTable.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsmultisitewpMsUsersListTablephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/multisite/wpMsUsersListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/wpMsUsersListTable.php                                (rev 0)
+++ trunk/tests/phpunit/tests/multisite/wpMsUsersListTable.php  2022-09-19 21:06:08 UTC (rev 54215)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,107 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group admin
+ * @group network-admin
+ * @group ms-required
+ *
+ * @covers WP_MS_Users_List_Table
+ */
+class Tests_Multisite_wpMsUsersListTable extends WP_UnitTestCase {
+       protected static $site_ids;
+
+       /**
+        * @var WP_MS_Users_List_Table
+        */
+       public $table = false;
+
+       public function set_up() {
+               parent::set_up();
+               $this->table = _get_list_table( 'WP_MS_Users_List_Table', array( 'screen' => 'ms-users' ) );
+       }
+
+       public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
+               self::$site_ids = array(
+                       'wordpress.org/'          => array(
+                               'domain' => 'wordpress.org',
+                               'path'   => '/',
+                       ),
+                       'wordpress.org/foo/'      => array(
+                               'domain' => 'wordpress.org',
+                               'path'   => '/foo/',
+                       ),
+                       'wordpress.org/foo/bar/'  => array(
+                               'domain' => 'wordpress.org',
+                               'path'   => '/foo/bar/',
+                       ),
+                       'wordpress.org/afoo/'     => array(
+                               'domain' => 'wordpress.org',
+                               'path'   => '/afoo/',
+                       ),
+                       'make.wordpress.org/'     => array(
+                               'domain' => 'make.wordpress.org',
+                               'path'   => '/',
+                       ),
+                       'make.wordpress.org/foo/' => array(
+                               'domain' => 'make.wordpress.org',
+                               'path'   => '/foo/',
+                       ),
+                       'www.w.org/'              => array(
+                               'domain' => 'www.w.org',
+                               'path'   => '/',
+                       ),
+                       'www.w.org/foo/'          => array(
+                               'domain' => 'www.w.org',
+                               'path'   => '/foo/',
+                       ),
+                       'www.w.org/foo/bar/'      => array(
+                               'domain' => 'www.w.org',
+                               'path'   => '/foo/bar/',
+                       ),
+                       'test.example.org/'       => array(
+                               'domain' => 'test.example.org',
+                               'path'   => '/',
+                       ),
+                       'test2.example.org/'      => array(
+                               'domain' => 'test2.example.org',
+                               'path'   => '/',
+                       ),
+                       'test3.example.org/zig/'  => array(
+                               'domain' => 'test3.example.org',
+                               'path'   => '/zig/',
+                       ),
+                       'atest.example.org/'      => array(
+                               'domain' => 'atest.example.org',
+                               'path'   => '/',
+                       ),
+               );
+
+               foreach ( self::$site_ids as &$id ) {
+                       $id = $factory->blog->create( $id );
+               }
+               unset( $id );
+       }
+
+       public static function wpTearDownAfterClass() {
+               foreach ( self::$site_ids as $site_id ) {
+                       wp_delete_site( $site_id );
+               }
+       }
+
+       /**
+        * @ticket 42066
+        *
+        * @covers WP_MS_Users_List_Table::get_views
+        */
+       public function test_get_views_should_return_views_by_default() {
+               $all   = get_user_count();
+               $super = count( get_super_admins() );
+
+               $expected = array(
+                       'all'   => '<a href="http://example.org/wp-admin/network/users.php" class="current" aria-current="page">All <span class="count">(' . $all . ')</span></a>',
+                       'super' => '<a href="http://example.org/wp-admin/network/users.php?role=super">Super Admin <span class="count">(' . $super . ')</span></a>',
+               );
+
+               $this->assertSame( $expected, $this->table->get_views() );
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/multisite/wpMsUsersListTable.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span></div>

</body>
</html>