Skip to content

Commit 6eb24f9

Browse files
committed
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develop into feat/phpstan
2 parents bf3ff47 + 6ac6187 commit 6eb24f9

14 files changed

Lines changed: 134 additions & 109 deletions

File tree

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

Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
3737
*
3838
* @see WP_List_Table::__construct() for more information on default arguments.
3939
*
40-
* @global string $status
41-
* @global int $page
40+
* @global string $status The current theme status.
41+
* @global int $page The current page number.
4242
*
4343
* @param array $args An associative array of arguments.
4444
*/
@@ -70,15 +70,19 @@ public function __construct( $args = array() ) {
7070
}
7171

7272
/**
73-
* @return array
73+
* Gets the list of CSS classes for the table tag.
74+
*
75+
* @return string[] The list of CSS classes.
7476
*/
7577
protected function get_table_classes() {
7678
// @todo Remove and add CSS for .themes.
7779
return array( 'widefat', 'plugins' );
7880
}
7981

8082
/**
81-
* @return bool
83+
* Checks if the current user has permissions to perform AJAX actions.
84+
*
85+
* @return bool True if the current user has permissions, false otherwise.
8286
*/
8387
public function ajax_user_can() {
8488
if ( $this->is_site_themes ) {
@@ -89,12 +93,14 @@ public function ajax_user_can() {
8993
}
9094

9195
/**
92-
* @global string $status
93-
* @global array $totals
94-
* @global int $page
95-
* @global string $orderby
96-
* @global string $order
97-
* @global string $s
96+
* Prepares the themes list for display.
97+
*
98+
* @global string $status The current theme status.
99+
* @global array<string, int> $totals An array of theme counts for each status.
100+
* @global int $page The current page number.
101+
* @global string $orderby The column to order the themes list by.
102+
* @global string $order The order of the themes list (ASC or DESC).
103+
* @global string $s The search string.
98104
*/
99105
public function prepare_items() {
100106
global $status, $totals, $page, $orderby, $order, $s;
@@ -261,8 +267,10 @@ public function prepare_items() {
261267
}
262268

263269
/**
264-
* @param WP_Theme $theme
265-
* @return bool
270+
* Filters a theme by the search term.
271+
*
272+
* @param WP_Theme $theme The WP_Theme object to check.
273+
* @return bool True if the theme matches the search term, false otherwise.
266274
*/
267275
public function _search_callback( $theme ) {
268276
static $term = null;
@@ -290,11 +298,14 @@ public function _search_callback( $theme ) {
290298

291299
// Not used by any core columns.
292300
/**
293-
* @global string $orderby
294-
* @global string $order
295-
* @param array $theme_a
296-
* @param array $theme_b
297-
* @return int
301+
* Compares the order of two themes by a specific field.
302+
*
303+
* @global string $orderby The column to order the themes list by.
304+
* @global string $order The order of the themes list (ASC or DESC).
305+
*
306+
* @param WP_Theme $theme_a The first theme to compare.
307+
* @param WP_Theme $theme_b The second theme to compare.
308+
* @return int 0 if equal, -1 if the first is less than the second, 1 if more.
298309
*/
299310
public function _order_callback( $theme_a, $theme_b ) {
300311
global $orderby, $order;
@@ -308,6 +319,7 @@ public function _order_callback( $theme_a, $theme_b ) {
308319
}
309320

310321
/**
322+
* Displays the message when there are no items to list.
311323
*/
312324
public function no_items() {
313325
if ( $this->has_items ) {
@@ -318,7 +330,9 @@ public function no_items() {
318330
}
319331

320332
/**
321-
* @return string[] Array of column titles keyed by their column name.
333+
* Gets the list of columns for the list table.
334+
*
335+
* @return array<string, string> Array of column titles keyed by their column name.
322336
*/
323337
public function get_columns() {
324338
$columns = array(
@@ -335,7 +349,9 @@ public function get_columns() {
335349
}
336350

337351
/**
338-
* @return array
352+
* Gets the list of sortable columns for the list table.
353+
*
354+
* @return array<string, array<int, mixed>> An array of sortable columns.
339355
*/
340356
protected function get_sortable_columns() {
341357
return array(
@@ -355,9 +371,12 @@ protected function get_primary_column_name() {
355371
}
356372

357373
/**
358-
* @global array $totals
359-
* @global string $status
360-
* @return array
374+
* Gets the list of views (statuses) for the list table.
375+
*
376+
* @global array<string, int> $totals An array of theme counts for each status.
377+
* @global string $status The current theme status.
378+
*
379+
* @return array<string, string> The list of views.
361380
*/
362381
protected function get_views() {
363382
global $totals, $status;
@@ -451,9 +470,11 @@ protected function get_views() {
451470
}
452471

453472
/**
454-
* @global string $status
473+
* Gets the list of bulk actions for the list table.
474+
*
475+
* @global string $status The current theme status.
455476
*
456-
* @return array
477+
* @return array<string, string> The list of bulk actions.
457478
*/
458479
protected function get_bulk_actions() {
459480
global $status;
@@ -532,9 +553,9 @@ public function column_cb( $item ) {
532553
*
533554
* @since 4.3.0
534555
*
535-
* @global string $status
536-
* @global int $page
537-
* @global string $s
556+
* @global string $status The current theme status.
557+
* @global int $page The current page number.
558+
* @global string $s The search string.
538559
*
539560
* @param WP_Theme $theme The current WP_Theme object.
540561
*/
@@ -689,8 +710,8 @@ public function column_name( $theme ) {
689710
*
690711
* @since 4.3.0
691712
*
692-
* @global string $status
693-
* @global array $totals
713+
* @global string $status The current theme status.
714+
* @global array<string, int> $totals An array of theme counts for each status.
694715
*
695716
* @param WP_Theme $theme The current WP_Theme object.
696717
*/
@@ -777,8 +798,8 @@ public function column_description( $theme ) {
777798
*
778799
* @since 5.5.0
779800
*
780-
* @global string $status
781-
* @global int $page
801+
* @global string $status The current theme status.
802+
* @global int $page The current page number.
782803
*
783804
* @param WP_Theme $theme The current WP_Theme object.
784805
*/
@@ -979,10 +1000,12 @@ public function single_row_columns( $item ) {
9791000
}
9801001

9811002
/**
982-
* @global string $status
983-
* @global array $totals
1003+
* Handles the output for a single table row.
1004+
*
1005+
* @global string $status The current theme status.
1006+
* @global array<string, int> $totals An array of theme counts for each status.
9841007
*
985-
* @param WP_Theme $theme
1008+
* @param WP_Theme $theme The current WP_Theme object.
9861009
*/
9871010
public function single_row( $theme ) {
9881011
global $status, $totals;

src/wp-admin/includes/file.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2187,7 +2187,7 @@ function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_own
21872187
$abstraction_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method );
21882188

21892189
if ( ! file_exists( $abstraction_file ) ) {
2190-
return;
2190+
return null;
21912191
}
21922192

21932193
require_once $abstraction_file;

src/wp-admin/includes/plugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ function delete_plugins( $plugins, $deprecated = '' ) {
926926
require_once ABSPATH . 'wp-admin/admin-footer.php';
927927
exit;
928928
}
929-
return;
929+
return null;
930930
}
931931

932932
if ( ! WP_Filesystem( $credentials ) ) {
@@ -941,7 +941,7 @@ function delete_plugins( $plugins, $deprecated = '' ) {
941941
require_once ABSPATH . 'wp-admin/admin-footer.php';
942942
exit;
943943
}
944-
return;
944+
return null;
945945
}
946946

947947
if ( ! is_object( $wp_filesystem ) ) {

src/wp-admin/includes/theme.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function delete_theme( $stylesheet, $redirect = '' ) {
4040
require_once ABSPATH . 'wp-admin/admin-footer.php';
4141
exit;
4242
}
43-
return;
43+
return null;
4444
}
4545

4646
if ( ! WP_Filesystem( $credentials ) ) {
@@ -55,7 +55,7 @@ function delete_theme( $stylesheet, $redirect = '' ) {
5555
require_once ABSPATH . 'wp-admin/admin-footer.php';
5656
exit;
5757
}
58-
return;
58+
return null;
5959
}
6060

6161
if ( ! is_object( $wp_filesystem ) ) {

src/wp-content/themes/twentytwentyfive/patterns/page-portfolio-home.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<div class="wp-block-columns alignwide">
5050
<!-- wp:column {"width":"66.66%"} -->
5151
<div class="wp-block-column" style="flex-basis:66.66%">
52-
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]},"layout":{"type":"default"}} -->
52+
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]},"layout":{"type":"default"}} -->
5353
<div class="wp-block-query">
5454
<!-- wp:post-template -->
5555
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->
@@ -71,7 +71,7 @@
7171
<!-- /wp:column -->
7272
<!-- wp:column {"width":"33.33%"} -->
7373
<div class="wp-block-column" style="flex-basis:33.33%">
74-
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"1","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]},"layout":{"type":"default"}} -->
74+
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"1","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]},"layout":{"type":"default"}} -->
7575
<div class="wp-block-query">
7676
<!-- wp:post-template -->
7777
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->
@@ -105,7 +105,7 @@
105105
<!-- wp:spacer {"height":"var:preset|spacing|30"} -->
106106
<div style="height:var(--wp--preset--spacing--30)" aria-hidden="true" class="wp-block-spacer"></div>
107107
<!-- /wp:spacer -->
108-
<!-- wp:query {"query":{"perPage":3,"pages":0,"offset":"2","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]},"align":"wide","layout":{"type":"default"}} -->
108+
<!-- wp:query {"query":{"perPage":3,"pages":0,"offset":"2","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]},"align":"wide","layout":{"type":"default"}} -->
109109
<div class="wp-block-query alignwide">
110110
<!-- wp:post-template {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"grid","columnCount":3}} -->
111111
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->
@@ -138,7 +138,7 @@
138138
<div class="wp-block-columns alignwide">
139139
<!-- wp:column {"width":"33.33%"} -->
140140
<div class="wp-block-column" style="flex-basis:33.33%">
141-
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"5","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]},"layout":{"type":"default"}} -->
141+
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"5","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]},"layout":{"type":"default"}} -->
142142
<div class="wp-block-query">
143143
<!-- wp:post-template -->
144144
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->
@@ -160,7 +160,7 @@
160160
<!-- /wp:column -->
161161
<!-- wp:column {"width":"66.66%"} -->
162162
<div class="wp-block-column" style="flex-basis:66.66%">
163-
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"6","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]},"layout":{"type":"default"}} -->
163+
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"6","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]},"layout":{"type":"default"}} -->
164164
<div class="wp-block-query">
165165
<!-- wp:post-template -->
166166
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->
@@ -187,7 +187,7 @@
187187
<div style="height:var(--wp--preset--spacing--70)" aria-hidden="true" class="wp-block-spacer"></div>
188188
<!-- /wp:spacer -->
189189

190-
<!-- wp:query {"query":{"perPage":3,"pages":0,"offset":"7","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]},"align":"wide","layout":{"type":"default"}} -->
190+
<!-- wp:query {"query":{"perPage":3,"pages":0,"offset":"7","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]},"align":"wide","layout":{"type":"default"}} -->
191191
<div class="wp-block-query alignwide">
192192
<!-- wp:post-template {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"grid","columnCount":3}} -->
193193
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->

src/wp-content/themes/twentytwentyfive/patterns/template-home-news-blog.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<div class="wp-block-column" style="flex-basis:25%">
2525
<!-- wp:group {"style":{"layout":{"columnSpan":1,"rowSpan":1}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"stretch"}} -->
2626
<div class="wp-block-group">
27-
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]}} -->
27+
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]}} -->
2828
<div class="wp-block-query">
2929
<!-- wp:post-template -->
3030
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->
@@ -42,7 +42,7 @@
4242
<!-- /wp:query-no-results -->
4343
</div>
4444
<!-- /wp:query -->
45-
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"3","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]}} -->
45+
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"3","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]}} -->
4646
<div class="wp-block-query">
4747
<!-- wp:post-template -->
4848
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->
@@ -61,7 +61,7 @@
6161
<!-- /wp:column -->
6262
<!-- wp:column {"width":"50%"} -->
6363
<div class="wp-block-column" style="flex-basis:50%">
64-
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"1","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]}} -->
64+
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"1","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]}} -->
6565
<div class="wp-block-query">
6666
<!-- wp:post-template -->
6767
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|30"}},"layout":{"type":"default"}} -->
@@ -81,7 +81,7 @@
8181
<div class="wp-block-column" style="flex-basis:25%">
8282
<!-- wp:group {"style":{"layout":{"columnSpan":1,"rowSpan":1}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"stretch"}} -->
8383
<div class="wp-block-group">
84-
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"2","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]}} -->
84+
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"2","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]}} -->
8585
<div class="wp-block-query">
8686
<!-- wp:post-template -->
8787
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->
@@ -94,7 +94,7 @@
9494
<!-- /wp:post-template -->
9595
</div>
9696
<!-- /wp:query -->
97-
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"4","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]}} -->
97+
<!-- wp:query {"query":{"perPage":1,"pages":0,"offset":"4","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]}} -->
9898
<div class="wp-block-query">
9999
<!-- wp:post-template -->
100100
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->
@@ -118,7 +118,7 @@
118118

119119
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"},"blockGap":"var:preset|spacing|50"}},"layout":{"type":"constrained"}} -->
120120
<div class="wp-block-group alignfull" style="padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50)">
121-
<!-- wp:query {"query":{"perPage":2,"pages":0,"offset":"5","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]},"align":"wide"} -->
121+
<!-- wp:query {"query":{"perPage":2,"pages":0,"offset":"5","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]},"align":"wide"} -->
122122
<div class="wp-block-query alignwide">
123123
<!-- wp:post-template {"style":{"spacing":{"blockGap":"var:preset|spacing|50"}},"layout":{"type":"grid","columnCount":2}} -->
124124
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->
@@ -136,7 +136,7 @@
136136

137137
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"}}},"layout":{"type":"constrained"}} -->
138138
<div class="wp-block-group alignfull" style="padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50)">
139-
<!-- wp:query {"query":{"perPage":6,"pages":0,"offset":"7","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]},"align":"wide"} -->
139+
<!-- wp:query {"query":{"perPage":6,"pages":0,"offset":"7","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]},"align":"wide"} -->
140140
<div class="wp-block-query alignwide">
141141
<!-- wp:post-template {"style":{"spacing":{"blockGap":"var:preset|spacing|50"}},"layout":{"type":"grid","columnCount":3}} -->
142142
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->

0 commit comments

Comments
 (0)