Skip to content
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2f2d7fd
Docs: Add missing documentation to Media and Multisite Sites List Tables
noruzzamans Feb 18, 2026
c87d9b8
Merge branch 'trunk' into fix-missing-documentation
noruzzamans Feb 18, 2026
1e94de4
Merge branch 'trunk' into fix-missing-documentation
noruzzamans Feb 19, 2026
34357ed
Merge branch 'trunk' into fix-missing-documentation
noruzzamans Feb 19, 2026
90341cd
Apply suggestion from @huzaifaalmesbah
noruzzamans Feb 19, 2026
420c486
Apply suggestion from @huzaifaalmesbah
noruzzamans Feb 19, 2026
42180d2
Apply suggestion from @huzaifaalmesbah
noruzzamans Feb 19, 2026
350b884
Merge branch 'trunk' of https://github.com/noruzzamans/wordpress-deve…
noruzzamans Feb 19, 2026
e0ee964
Merge branch 'trunk' into fix-missing-documentation
noruzzamans Feb 20, 2026
d3615f1
Docs: Fix missing documentation in WP_MS_Themes_List_Table
noruzzamans Feb 20, 2026
e21b583
Apply suggestions from code review
noruzzamans Feb 20, 2026
d4f6d21
Apply suggestions from code review
noruzzamans Feb 20, 2026
cfcb33e
Apply suggestion from @huzaifaalmesbah
noruzzamans Feb 20, 2026
91f0b64
Merge branch 'trunk' into fix-missing-documentation
noruzzamans Feb 21, 2026
0ba7359
Update src/wp-admin/includes/class-wp-ms-themes-list-table.php
noruzzamans Feb 22, 2026
58ead8d
Update src/wp-admin/includes/class-wp-ms-themes-list-table.php
noruzzamans Feb 22, 2026
27914ef
Use WP_Theme as param type instead of array
westonruter Feb 23, 2026
23b9b9e
Merge branch 'trunk' into fix-missing-documentation
westonruter Feb 23, 2026
686ebfc
Use more specific return type for get_columns()
westonruter Feb 23, 2026
34a7845
Docs: Refine no_items() summary in WP_MS_Themes_List_Table
westonruter Feb 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 57 additions & 34 deletions src/wp-admin/includes/class-wp-ms-themes-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
* @global string $status
* @global int $page
* @global string $status The current theme status.
* @global int $page The current page number.
*
* @param array $args An associative array of arguments.
*/
Expand Down Expand Up @@ -70,15 +70,19 @@ public function __construct( $args = array() ) {
}

/**
* @return array
* Gets the list of CSS classes for the table tag.
*
* @return string[] The list of CSS classes.
*/
protected function get_table_classes() {
// @todo Remove and add CSS for .themes.
return array( 'widefat', 'plugins' );
}

/**
* @return bool
* Checks if the current user has permissions to perform AJAX actions.
*
* @return bool True if the current user has permissions, false otherwise.
*/
public function ajax_user_can() {
if ( $this->is_site_themes ) {
Expand All @@ -89,12 +93,14 @@ public function ajax_user_can() {
}

/**
* @global string $status
* @global array $totals
* @global int $page
* @global string $orderby
* @global string $order
* @global string $s
* Prepares the themes list for display.
*
* @global string $status The current theme status.
* @global array<string, int> $totals An array of theme counts for each status.
* @global int $page The current page number.
* @global string $orderby The column to order the themes list by.
* @global string $order The order of the themes list (ASC or DESC).
* @global string $s The search string.
*/
public function prepare_items() {
global $status, $totals, $page, $orderby, $order, $s;
Expand Down Expand Up @@ -261,8 +267,10 @@ public function prepare_items() {
}

/**
* @param WP_Theme $theme
* @return bool
* Filters a theme by the search term.
*
* @param WP_Theme $theme The WP_Theme object to check.
* @return bool True if the theme matches the search term, false otherwise.
*/
public function _search_callback( $theme ) {
static $term = null;
Expand Down Expand Up @@ -290,11 +298,14 @@ public function _search_callback( $theme ) {

// Not used by any core columns.
/**
* @global string $orderby
* @global string $order
* @param array $theme_a
* @param array $theme_b
* @return int
* Compares the order of two themes by a specific field.
*
* @global string $orderby The column to order the themes list by.
* @global string $order The order of the themes list (ASC or DESC).
*
* @param WP_Theme $theme_a The first theme to compare.
* @param WP_Theme $theme_b The second theme to compare.
* @return int 0 if equal, -1 if the first is less than the second, 1 if more.
*/
public function _order_callback( $theme_a, $theme_b ) {
global $orderby, $order;
Expand All @@ -308,6 +319,7 @@ public function _order_callback( $theme_a, $theme_b ) {
}

/**
* Displays the message when there are no items to list.
*/
public function no_items() {
if ( $this->has_items ) {
Expand All @@ -318,7 +330,9 @@ public function no_items() {
}

/**
* @return string[] Array of column titles keyed by their column name.
* Gets the list of columns for the list table.
*
* @return array<string, string> Array of column titles keyed by their column name.
*/
public function get_columns() {
$columns = array(
Expand All @@ -335,7 +349,9 @@ public function get_columns() {
}

/**
* @return array
* Gets the list of sortable columns for the list table.
*
* @return array<string, array<int, mixed>> An array of sortable columns.
*/
protected function get_sortable_columns() {
return array(
Expand All @@ -355,9 +371,12 @@ protected function get_primary_column_name() {
}

/**
* @global array $totals
* @global string $status
* @return array
* Gets the list of views (statuses) for the list table.
*
* @global array<string, int> $totals An array of theme counts for each status.
* @global string $status The current theme status.
*
* @return array<string, string> The list of views.
*/
protected function get_views() {
global $totals, $status;
Expand Down Expand Up @@ -451,9 +470,11 @@ protected function get_views() {
}

/**
* @global string $status
* Gets the list of bulk actions for the list table.
*
* @global string $status The current theme status.
*
* @return array
* @return array<string, string> The list of bulk actions.
*/
protected function get_bulk_actions() {
global $status;
Expand Down Expand Up @@ -532,9 +553,9 @@ public function column_cb( $item ) {
*
* @since 4.3.0
*
* @global string $status
* @global int $page
* @global string $s
* @global string $status The current theme status.
* @global int $page The current page number.
* @global string $s The search string.
*
* @param WP_Theme $theme The current WP_Theme object.
*/
Expand Down Expand Up @@ -689,8 +710,8 @@ public function column_name( $theme ) {
*
* @since 4.3.0
*
* @global string $status
* @global array $totals
* @global string $status The current theme status.
* @global array<string, int> $totals An array of theme counts for each status.
*
* @param WP_Theme $theme The current WP_Theme object.
*/
Expand Down Expand Up @@ -777,8 +798,8 @@ public function column_description( $theme ) {
*
* @since 5.5.0
*
* @global string $status
* @global int $page
* @global string $status The current theme status.
* @global int $page The current page number.
*
* @param WP_Theme $theme The current WP_Theme object.
*/
Expand Down Expand Up @@ -979,10 +1000,12 @@ public function single_row_columns( $item ) {
}

/**
* @global string $status
* @global array $totals
* Handles the output for a single table row.
*
* @global string $status The current theme status.
* @global array<string, int> $totals An array of theme counts for each status.
*
* @param WP_Theme $theme
* @param WP_Theme $theme The current WP_Theme object.
*/
public function single_row( $theme ) {
global $status, $totals;
Expand Down
Loading