[wp-trac] [WordPress Trac] #65102: WP_MS_Users_List_Table::display_rows() should emit id="user-{ID}" on <tr> to match WP_Users_List_Table

WordPress Trac noreply at wordpress.org
Wed Apr 22 06:20:30 UTC 2026


#65102: WP_MS_Users_List_Table::display_rows() should emit id="user-{ID}" on <tr>
to match WP_Users_List_Table
------------------------------+----------------------------------------
 Reporter:  dd32              |       Owner:  johnjamesjacoby
     Type:  defect (bug)      |      Status:  accepted
 Priority:  normal            |   Milestone:  7.1
Component:  Users             |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:  administration, multisite
------------------------------+----------------------------------------

Comment (by alexodiy):

 Tested PR [https://github.com/WordPress/wordpress-develop/pull/11600
 #11600] on a multisite install against trunk.

 == Environment ==

 * WordPress: trunk (multisite enabled)
 * Environment: `wordpress-develop` Docker stack (`npm run env:install`
 with `LOCAL_MULTISITE=true`)
 * Test users: 4 network users (IDs 1-4) with mixed roles

 == Test plan (per @dd32, comment:1) ==

 1. Load `wp-admin/network/users.php` and confirm each `<tr>` carries
 `id="user-{ID}"`.
 2. Confirm per-site `wp-admin/users.php` is unchanged.

 == Results ==

 '''Before patch (trunk):'''

 On `wp-admin/network/users.php`, every `<tr>` in the users table renders
 without an `id` attribute. Bug confirmed.

 '''After patch:'''

 On `wp-admin/network/users.php`, every `<tr>` renders with
 `id="user-{ID}"` matching the user's numeric ID:

 {{{
 <tr id="user-1" class="alternate">
 <tr id="user-2">
 <tr id="user-3" class="alternate">
 <tr id="user-4">
 }}}

 Per-site `wp-admin/users.php` is unaffected - the existing
 `id="user-{ID}"` continues to render as before (handled by
 `WP_Users_List_Table`, untouched).

 ||= Scenario =||= Before Patch =||= After Patch =||
 || `network/users.php` `<tr>` id || missing || `id="user-{ID}"` present ||
 || per-site `users.php` `<tr>` id || `id="user-{ID}"` || `id="user-{ID}"`
 (unchanged) ||

 The `(int)` cast on `$user->ID` is a sensible defensive measure given
 `WP_User::$ID` is untyped (see inline discussion on the PR).

 Patch looks correct and minimal. +1 for commit.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/65102#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list