Skip to content

Commit 960113d

Browse files
author
costdev
committed
MS Users: Use ::get_views_links() in list table.
1 parent fdca7d0 commit 960113d

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

src/wp-admin/includes/class-wp-ms-users-list-table.php

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,10 @@ protected function get_views() {
137137
$super_admins = get_super_admins();
138138
$total_admins = count( $super_admins );
139139

140-
$current_link_attributes = 'super' !== $role ? ' class="current" aria-current="page"' : '';
141-
$role_links = array();
142-
$role_links['all'] = sprintf(
143-
'<a href="%s"%s>%s</a>',
144-
network_admin_url( 'users.php' ),
145-
$current_link_attributes,
146-
sprintf(
140+
$role_links = array();
141+
$role_links['all'] = array(
142+
'url' => network_admin_url( 'users.php' ),
143+
'label' => sprintf(
147144
/* translators: Number of users. */
148145
_nx(
149146
'All <span class="count">(%s)</span>',
@@ -152,25 +149,25 @@ protected function get_views() {
152149
'users'
153150
),
154151
number_format_i18n( $total_users )
155-
)
152+
),
153+
'current' => 'super' !== $role,
156154
);
157-
$current_link_attributes = 'super' === $role ? ' class="current" aria-current="page"' : '';
158-
$role_links['super'] = sprintf(
159-
'<a href="%s"%s>%s</a>',
160-
network_admin_url( 'users.php?role=super' ),
161-
$current_link_attributes,
162-
sprintf(
155+
156+
$role_links['super'] = array(
157+
'url' => network_admin_url( 'users.php?role=super' ),
158+
'label' => sprintf(
163159
/* translators: Number of users. */
164160
_n(
165161
'Super Admin <span class="count">(%s)</span>',
166162
'Super Admins <span class="count">(%s)</span>',
167163
$total_admins
168164
),
169165
number_format_i18n( $total_admins )
170-
)
166+
),
167+
'current' => 'super' === $role,
171168
);
172169

173-
return $role_links;
170+
return $this->get_views_links( $role_links );
174171
}
175172

176173
/**

0 commit comments

Comments
 (0)