From a6dfa216d07da874cf60eb5c5b97bfae7e687255 Mon Sep 17 00:00:00 2001 From: noruzzamans Date: Tue, 24 Feb 2026 09:22:16 +0600 Subject: [PATCH 01/10] Docs: Fix missing documentation in list tables --- .../includes/class-wp-ms-users-list-table.php | 58 ++++++++++++---- .../class-wp-plugin-install-list-table.php | 67 ++++++++++++++----- 2 files changed, 96 insertions(+), 29 deletions(-) diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index b4cbf8457a0b4..fcacea6de6436 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -16,16 +16,24 @@ */ class WP_MS_Users_List_Table extends WP_List_Table { /** - * @return bool + * Checks if the current user has permissions to perform an Ajax action. + * + * @since 3.1.0 + * + * @return bool Whether the current user can perform an Ajax action. */ public function ajax_user_can() { return current_user_can( 'manage_network_users' ); } /** + * Prepares the users list for display. + * + * @since 3.1.0 + * * @global string $mode List table view mode. - * @global string $usersearch - * @global string $role + * @global string $usersearch User search query. + * @global string $role The user role to filter by. */ public function prepare_items() { global $mode, $usersearch, $role; @@ -106,7 +114,11 @@ public function prepare_items() { } /** - * @return array + * Gets the list of bulk actions for the users list table. + * + * @since 3.1.0 + * + * @return array Array of bulk action labels keyed by their action name. */ protected function get_bulk_actions() { $actions = array(); @@ -120,14 +132,22 @@ protected function get_bulk_actions() { } /** + * Outputs the message when no users are found. + * + * @since 3.1.0 */ public function no_items() { _e( 'No users found.' ); } /** - * @global string $role - * @return array + * Gets the list of views (all, super admin) available for the users list table. + * + * @since 3.1.0 + * + * @global string $role The user role to filter by. + * + * @return array Array of view links. */ protected function get_views() { global $role; @@ -170,9 +190,13 @@ protected function get_views() { } /** + * Generates the list table pagination. + * + * @since 3.1.0 + * * @global string $mode List table view mode. * - * @param string $which + * @param string $which The location of the pagination: 'top' or 'bottom'. */ protected function pagination( $which ) { global $mode; @@ -185,6 +209,10 @@ protected function pagination( $which ) { } /** + * Gets the list of columns for the users list table. + * + * @since 3.1.0 + * * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { @@ -208,7 +236,11 @@ public function get_columns() { } /** - * @return array + * Gets the list of sortable columns for the users list table. + * + * @since 3.1.0 + * + * @return array Array of sortable columns. */ protected function get_sortable_columns() { return array( @@ -349,12 +381,14 @@ public function column_registered( $user ) { } /** + * Outputs the sites column content. + * * @since 4.3.0 * - * @param WP_User $user - * @param string $classes - * @param string $data - * @param string $primary + * @param WP_User $user The current WP_User object. + * @param string $classes CSS classes for the cell. + * @param string $data Custom data attributes for the cell. + * @param string $primary The primary column name. */ protected function _column_blogs( $user, $classes, $data, $primary ) { echo ''; diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php index a029d725d7b75..c365271061f15 100644 --- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -23,7 +23,11 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { private $error; /** - * @return bool + * Checks if the current user has permissions to perform an Ajax action. + * + * @since 3.1.0 + * + * @return bool Whether the current user can perform an Ajax action. */ public function ajax_user_can() { return current_user_can( 'install_plugins' ); @@ -80,11 +84,15 @@ protected function get_installed_plugin_slugs() { } /** - * @global array $tabs - * @global string $tab - * @global int $paged - * @global string $type - * @global string $term + * Prepares the plugins list for display. + * + * @since 3.1.0 + * + * @global array $tabs The tabs shown on the Add Plugins screen. + * @global string $tab The current active tab. + * @global int $paged The current page number. + * @global string $type The type of search being performed. + * @global string $term The search term. */ public function prepare_items() { require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; @@ -287,6 +295,9 @@ public function prepare_items() { } /** + * Outputs the message when no plugins are found. + * + * @since 3.1.0 */ public function no_items() { if ( isset( $this->error ) ) { @@ -307,10 +318,14 @@ public function no_items() { } /** - * @global array $tabs - * @global string $tab + * Gets the list of views (tabs) available for the plugins list table. * - * @return array + * @since 3.1.0 + * + * @global array $tabs The tabs shown on the Add Plugins screen. + * @global string $tab The current active tab. + * + * @return array Array of view links. */ protected function get_views() { global $tabs, $tab; @@ -330,7 +345,9 @@ protected function get_views() { } /** - * Overrides parent views so we can use the filter bar display. + * Displays the view (tabs) switcher for the plugins list table. + * + * @since 3.1.0 */ public function views() { $views = $this->get_views(); @@ -395,9 +412,13 @@ public function display() { } /** - * @global string $tab + * Generates the table navigation. * - * @param string $which + * @since 3.1.0 + * + * @global string $tab The current active tab. + * + * @param string $which The location of the pagination: 'top' or 'bottom'. */ protected function display_tablenav( $which ) { if ( 'featured' === $GLOBALS['tab'] ) { @@ -431,23 +452,35 @@ protected function display_tablenav( $which ) { } /** - * @return array + * Gets the list of CSS classes for the table container. + * + * @since 3.1.0 + * + * @return array Array of CSS classes. */ protected function get_table_classes() { return array( 'widefat', $this->_args['plural'] ); } /** - * @return string[] Array of column titles keyed by their column name. + * Gets the list of columns for the plugins list table. + * + * @since 3.1.0 + * + * @return array Array of column titles. */ public function get_columns() { return array(); } /** - * @param object $plugin_a - * @param object $plugin_b - * @return int + * Callback for sorting plugins. + * + * @since 3.1.0 + * + * @param object $plugin_a The first plugin object. + * @param object $plugin_b The second plugin object. + * @return int Comparison result. */ private function order_callback( $plugin_a, $plugin_b ) { $orderby = $this->orderby; From 6dea2847f2b951182819eff6a9b97cf43051b8ed Mon Sep 17 00:00:00 2001 From: Noruzzaman Date: Tue, 24 Feb 2026 10:26:39 +0600 Subject: [PATCH 02/10] Update src/wp-admin/includes/class-wp-ms-users-list-table.php Co-authored-by: Huzaifa Al Mesbah --- src/wp-admin/includes/class-wp-ms-users-list-table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index fcacea6de6436..ce282683a1b04 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -118,7 +118,7 @@ public function prepare_items() { * * @since 3.1.0 * - * @return array Array of bulk action labels keyed by their action name. + * @return array> An associative array of bulk actions. */ protected function get_bulk_actions() { $actions = array(); From adf8e85ff9ab924f8aecc3be45a2f10f58eeb71a Mon Sep 17 00:00:00 2001 From: Noruzzaman Date: Tue, 24 Feb 2026 10:26:57 +0600 Subject: [PATCH 03/10] Update src/wp-admin/includes/class-wp-ms-users-list-table.php Co-authored-by: Huzaifa Al Mesbah --- src/wp-admin/includes/class-wp-ms-users-list-table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index ce282683a1b04..8ab824446c914 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -114,7 +114,7 @@ public function prepare_items() { } /** - * Gets the list of bulk actions for the users list table. + * Gets the available bulk actions for the users list table. * * @since 3.1.0 * From b865078122ca8189876a2f8c548fe76544e54431 Mon Sep 17 00:00:00 2001 From: Noruzzaman Date: Tue, 24 Feb 2026 10:27:10 +0600 Subject: [PATCH 04/10] Update src/wp-admin/includes/class-wp-ms-users-list-table.php Co-authored-by: Huzaifa Al Mesbah --- src/wp-admin/includes/class-wp-ms-users-list-table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index 8ab824446c914..c4e6fe3a42a0d 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -132,7 +132,7 @@ protected function get_bulk_actions() { } /** - * Outputs the message when no users are found. + * Message to be displayed when there are no items. * * @since 3.1.0 */ From 668aca406134ced22894cbcc30f97e40cd490b6e Mon Sep 17 00:00:00 2001 From: Noruzzaman Date: Tue, 24 Feb 2026 10:27:32 +0600 Subject: [PATCH 05/10] Update src/wp-admin/includes/class-wp-ms-users-list-table.php Co-authored-by: Huzaifa Al Mesbah --- src/wp-admin/includes/class-wp-ms-users-list-table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index c4e6fe3a42a0d..a1feb7c2eec8e 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -147,7 +147,7 @@ public function no_items() { * * @global string $role The user role to filter by. * - * @return array Array of view links. + * @return array An associative array of views. */ protected function get_views() { global $role; From 489c77f56bba4ad40b2d500d8e0284b5f0662c84 Mon Sep 17 00:00:00 2001 From: Noruzzaman Date: Tue, 24 Feb 2026 13:08:03 +0600 Subject: [PATCH 06/10] Update src/wp-admin/includes/class-wp-ms-users-list-table.php Co-authored-by: Weston Ruter --- src/wp-admin/includes/class-wp-ms-users-list-table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index a1feb7c2eec8e..1cd67569b004d 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -132,7 +132,7 @@ protected function get_bulk_actions() { } /** - * Message to be displayed when there are no items. + * Displays a message when there are no items. * * @since 3.1.0 */ From 4574c4b8d04fc0570b7489bccc398e8204591a10 Mon Sep 17 00:00:00 2001 From: Noruzzaman Date: Tue, 24 Feb 2026 13:08:20 +0600 Subject: [PATCH 07/10] Update src/wp-admin/includes/class-wp-ms-users-list-table.php Co-authored-by: Weston Ruter --- src/wp-admin/includes/class-wp-ms-users-list-table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index 1cd67569b004d..19002dafa67a7 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -240,7 +240,7 @@ public function get_columns() { * * @since 3.1.0 * - * @return array Array of sortable columns. + * @return array Sortable columns. */ protected function get_sortable_columns() { return array( From 28a3cc659be4b14bb9c6b6c6a2b88c5cdfc75c91 Mon Sep 17 00:00:00 2001 From: Noruzzaman Date: Tue, 24 Feb 2026 13:08:55 +0600 Subject: [PATCH 08/10] Update src/wp-admin/includes/class-wp-plugin-install-list-table.php Co-authored-by: Weston Ruter --- src/wp-admin/includes/class-wp-plugin-install-list-table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php index c365271061f15..dbdaf3b927abe 100644 --- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -456,7 +456,7 @@ protected function display_tablenav( $which ) { * * @since 3.1.0 * - * @return array Array of CSS classes. + * @return string[] CSS classes. */ protected function get_table_classes() { return array( 'widefat', $this->_args['plural'] ); From 6c5b333bb6a81cf5bec35fdb4081fe0e504302f7 Mon Sep 17 00:00:00 2001 From: noruzzamans Date: Tue, 24 Feb 2026 13:38:52 +0600 Subject: [PATCH 09/10] Docs: Address reviewer feedback in WP_Plugin_Install_List_Table --- .../includes/class-wp-plugin-install-list-table.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php index dbdaf3b927abe..dfc8303bb347f 100644 --- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -322,10 +322,10 @@ public function no_items() { * * @since 3.1.0 * - * @global array $tabs The tabs shown on the Add Plugins screen. - * @global string $tab The current active tab. + * @global string[] $tabs The tabs shown on the Add Plugins screen. + * @global string $tab The current active tab. * - * @return array Array of view links. + * @return string[] Array of view links keyed by their ID. */ protected function get_views() { global $tabs, $tab; @@ -467,7 +467,7 @@ protected function get_table_classes() { * * @since 3.1.0 * - * @return array Array of column titles. + * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { return array(); From 5f9e0b5642e3139cfa0fa090a869c9c875210501 Mon Sep 17 00:00:00 2001 From: Noruzzaman Date: Wed, 25 Feb 2026 13:10:21 +0600 Subject: [PATCH 10/10] Apply suggestions from code review Co-authored-by: Weston Ruter --- src/wp-admin/includes/class-wp-ms-users-list-table.php | 7 ++++--- .../includes/class-wp-plugin-install-list-table.php | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index 19002dafa67a7..fca80f439ca66 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -118,7 +118,7 @@ public function prepare_items() { * * @since 3.1.0 * - * @return array> An associative array of bulk actions. + * @return array An associative array of bulk actions. */ protected function get_bulk_actions() { $actions = array(); @@ -213,7 +213,7 @@ protected function pagination( $which ) { * * @since 3.1.0 * - * @return string[] Array of column titles keyed by their column name. + * @return array Array of column titles keyed by their column name. */ public function get_columns() { $users_columns = array( @@ -230,7 +230,8 @@ public function get_columns() { * @since MU (3.0.0) * * @param string[] $users_columns An array of user columns. Default 'cb', 'username', - * 'name', 'email', 'registered', 'blogs'. + * @param array $users_columns An array of user columns. Default 'cb', 'username', + * 'name', 'email', 'registered', 'blogs'. */ return apply_filters( 'wpmu_users_columns', $users_columns ); } diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php index dfc8303bb347f..ba276b346f8f5 100644 --- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -322,10 +322,10 @@ public function no_items() { * * @since 3.1.0 * - * @global string[] $tabs The tabs shown on the Add Plugins screen. - * @global string $tab The current active tab. + * @global array $tabs The tabs shown on the Add Plugins screen. + * @global string $tab The current active tab. * - * @return string[] Array of view links keyed by their ID. + * @return array Array of view links keyed by their ID. */ protected function get_views() { global $tabs, $tab; @@ -467,7 +467,7 @@ protected function get_table_classes() { * * @since 3.1.0 * - * @return string[] Array of column titles keyed by their column name. + * @return array Array of column titles keyed by their column name. */ public function get_columns() { return array();