diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/includes/class-wp-users-list-table.php
--- a/wp/wp-admin/includes/class-wp-users-list-table.php Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-admin/includes/class-wp-users-list-table.php Fri Sep 05 18:40:08 2025 +0200
@@ -11,7 +11,6 @@
* Core class used to implement displaying users in a list table.
*
* @since 3.1.0
- * @access private
*
* @see WP_List_Table
*/
@@ -59,7 +58,7 @@
}
/**
- * Check the current user's permissions.
+ * Checks the current user's permissions.
*
* @since 3.1.0
*
@@ -74,7 +73,7 @@
}
/**
- * Prepare the users list for display.
+ * Prepares the users list for display.
*
* @since 3.1.0
*
@@ -151,7 +150,7 @@
}
/**
- * Output 'no users' message.
+ * Outputs 'no users' message.
*
* @since 3.1.0
*/
@@ -160,11 +159,11 @@
}
/**
- * Return an associative array listing all the views that can be used
+ * Returns an associative array listing all the views that can be used
* with this table.
*
* Provides a list of roles and user count for that role for easy
- * Filtersing of the user table.
+ * filtering of the user table.
*
* @since 3.1.0
*
@@ -185,10 +184,9 @@
$url = 'users.php';
}
- $role_links = array();
- $avail_roles = array();
- $all_text = __( 'All' );
- $current_link_attributes = empty( $role ) ? ' class="current" aria-current="page"' : '';
+ $role_links = array();
+ $avail_roles = array();
+ $all_text = __( 'All' );
if ( $count_users ) {
if ( $this->is_site_users ) {
@@ -215,19 +213,17 @@
);
}
- $role_links['all'] = sprintf( '%s', $url, $current_link_attributes, $all_text );
+ $role_links['all'] = array(
+ 'url' => $url,
+ 'label' => $all_text,
+ 'current' => empty( $role ),
+ );
foreach ( $wp_roles->get_names() as $this_role => $name ) {
if ( $count_users && ! isset( $avail_roles[ $this_role ] ) ) {
continue;
}
- $current_link_attributes = '';
-
- if ( $this_role === $role ) {
- $current_link_attributes = ' class="current" aria-current="page"';
- }
-
$name = translate_user_role( $name );
if ( $count_users ) {
$name = sprintf(
@@ -238,17 +234,15 @@
);
}
- $role_links[ $this_role ] = "$name";
+ $role_links[ $this_role ] = array(
+ 'url' => esc_url( add_query_arg( 'role', $this_role, $url ) ),
+ 'label' => $name,
+ 'current' => $this_role === $role,
+ );
}
if ( ! empty( $avail_roles['none'] ) ) {
- $current_link_attributes = '';
-
- if ( 'none' === $role ) {
- $current_link_attributes = ' class="current" aria-current="page"';
- }
-
$name = __( 'No role' );
$name = sprintf(
/* translators: 1: User role name, 2: Number of users. */
@@ -257,14 +251,18 @@
number_format_i18n( $avail_roles['none'] )
);
- $role_links['none'] = "$name";
+ $role_links['none'] = array(
+ 'url' => esc_url( add_query_arg( 'role', 'none', $url ) ),
+ 'label' => $name,
+ 'current' => 'none' === $role,
+ );
}
- return $role_links;
+ return $this->get_views_links( $role_links );
}
/**
- * Retrieve an associative array of bulk actions available on this table.
+ * Retrieves an associative array of bulk actions available on this table.
*
* @since 3.1.0
*
@@ -292,7 +290,7 @@
}
/**
- * Output the controls to allow user roles to be changed in bulk.
+ * Outputs the controls to allow user roles to be changed in bulk.
*
* @since 3.1.0
*
@@ -305,7 +303,12 @@
?>
has_items() ) : ?>
-
+