Skip to content

Commit 36b480b

Browse files
committed
Merge branch 'trunk' into feature/64229-warn-missing-dependencies
2 parents 3706e96 + 3f93553 commit 36b480b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1121
-486
lines changed

Gruntfile.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@ module.exports = function(grunt) {
5959
'!wp-includes/assets/script-modules-packages.min.php',
6060
],
6161

62+
// All workflow files that should be deleted from non-default branches.
63+
workflowFiles = [
64+
// Reusable workflows should be called from `trunk` within branches.
65+
'.github/workflows/reusable-*.yml',
66+
// These workflows are only intended to run from `trunk`.
67+
'.github/workflows/commit-built-file-changes.yml',
68+
'.github/workflows/failed-workflow.yml',
69+
'.github/workflows/install-testing.yml',
70+
'.github/workflows/test-and-zip-default-themes.yml',
71+
'.github/workflows/install-testing.yml',
72+
'.github/workflows/slack-notifications.yml',
73+
'.github/workflows/test-coverage.yml',
74+
'.github/workflows/test-old-branches.yml',
75+
'.github/workflows/upgrade-testing.yml'
76+
],
77+
6278
// Prepend `dir` to `file`, and keep `!` in place.
6379
setFilePath = function( dir, file ) {
6480
if ( '!' === file.charAt( 0 ) ) {
@@ -216,7 +232,18 @@ module.exports = function(grunt) {
216232
cwd: WORKING_DIR,
217233
src: []
218234
},
219-
qunit: ['tests/qunit/compiled.html']
235+
qunit: ['tests/qunit/compiled.html'],
236+
237+
// This is only meant to run within a numbered branch after branching has occurred.
238+
workflows: {
239+
filter: function() {
240+
var allowedTasks = [ 'post-branching', 'clean:workflows' ];
241+
return allowedTasks.some( function( task ) {
242+
return grunt.cli.tasks.indexOf( task ) !== -1;
243+
} );
244+
},
245+
src: workflowFiles
246+
},
220247
},
221248
file_append: {
222249
// grunt-file-append supports only strings for input and output.
@@ -1708,6 +1735,11 @@ module.exports = function(grunt) {
17081735
'copy:workflow-references-remote-to-local',
17091736
]);
17101737

1738+
grunt.registerTask( 'post-branching', [
1739+
'clean:workflows',
1740+
'replace:workflow-references-local-to-remote'
1741+
]);
1742+
17111743
/**
17121744
* Build verification tasks.
17131745
*/

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
},
2121
"require-dev": {
2222
"composer/ca-bundle": "1.5.9",
23-
"squizlabs/php_codesniffer": "3.13.2",
24-
"wp-coding-standards/wpcs": "~3.2.0",
23+
"squizlabs/php_codesniffer": "3.13.5",
24+
"wp-coding-standards/wpcs": "~3.3.0",
2525
"phpcompatibility/phpcompatibility-wp": "~2.1.3",
2626
"yoast/phpunit-polyfills": "^1.1.0"
2727
},

src/wp-admin/includes/ajax-actions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4804,6 +4804,8 @@ function wp_ajax_search_plugins() {
48044804
// Ensure after_plugin_row_{$plugin_file} gets hooked.
48054805
wp_plugin_update_rows();
48064806

4807+
WP_Plugin_Dependencies::initialize();
4808+
48074809
$pagenow = isset( $_POST['pagenow'] ) ? sanitize_key( $_POST['pagenow'] ) : '';
48084810
if ( 'plugins-network' === $pagenow || 'plugins' === $pagenow ) {
48094811
set_current_screen( $pagenow );

src/wp-admin/includes/class-wp-filesystem-ftpext.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public function chmod( $file, $mode = false, $recursive = false ) {
299299
public function owner( $file ) {
300300
$dir = $this->dirlist( $file );
301301

302-
return $dir[ $file ]['owner'];
302+
return $dir[ $file ]['owner'] ?? '';
303303
}
304304

305305
/**
@@ -313,7 +313,7 @@ public function owner( $file ) {
313313
public function getchmod( $file ) {
314314
$dir = $this->dirlist( $file );
315315

316-
return $dir[ $file ]['permsn'];
316+
return $dir[ $file ]['permsn'] ?? '';
317317
}
318318

319319
/**
@@ -327,7 +327,7 @@ public function getchmod( $file ) {
327327
public function group( $file ) {
328328
$dir = $this->dirlist( $file );
329329

330-
return $dir[ $file ]['group'];
330+
return $dir[ $file ]['group'] ?? '';
331331
}
332332

333333
/**

src/wp-admin/includes/class-wp-filesystem-ftpsockets.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public function chmod( $file, $mode = false, $recursive = false ) {
309309
public function owner( $file ) {
310310
$dir = $this->dirlist( $file );
311311

312-
return $dir[ $file ]['owner'];
312+
return $dir[ $file ]['owner'] ?? '';
313313
}
314314

315315
/**
@@ -323,7 +323,7 @@ public function owner( $file ) {
323323
public function getchmod( $file ) {
324324
$dir = $this->dirlist( $file );
325325

326-
return $dir[ $file ]['permsn'];
326+
return $dir[ $file ]['permsn'] ?? '';
327327
}
328328

329329
/**
@@ -337,7 +337,7 @@ public function getchmod( $file ) {
337337
public function group( $file ) {
338338
$dir = $this->dirlist( $file );
339339

340-
return $dir[ $file ]['group'];
340+
return $dir[ $file ]['group'] ?? '';
341341
}
342342

343343
/**

src/wp-admin/includes/class-wp-screen.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,10 @@ final class WP_Screen {
175175
/**
176176
* Stores the result of the public show_screen_options function.
177177
*
178+
* Set when calling {@see self::show_screen_options()} for the first time.
179+
*
178180
* @since 3.3.0
179-
* @var bool
181+
* @var ?bool
180182
*/
181183
private $_show_screen_options;
182184

@@ -545,7 +547,7 @@ public function get_options() {
545547
* @param string $option Option name.
546548
* @param string|false $key Optional. Specific array key for when the option is an array.
547549
* Default false.
548-
* @return string The option value if set, null otherwise.
550+
* @return ?string The option value if set, null otherwise.
549551
*/
550552
public function get_option( $option, $key = false ) {
551553
if ( ! isset( $this->_options[ $option ] ) ) {
@@ -598,7 +600,7 @@ public function get_help_tabs() {
598600
* @since 3.4.0
599601
*
600602
* @param string $id Help Tab ID.
601-
* @return array Help tab arguments.
603+
* @return ?array Help tab arguments, or null if no help tabs added.
602604
*/
603605
public function get_help_tab( $id ) {
604606
if ( ! isset( $this->_help_tabs[ $id ] ) ) {
@@ -733,7 +735,7 @@ public function get_screen_reader_content() {
733735
* @since 4.4.0
734736
*
735737
* @param string $key Screen reader text array named key.
736-
* @return string Screen reader text string.
738+
* @return ?string Screen reader text string, or null if no text is associated with the key.
737739
*/
738740
public function get_screen_reader_text( $key ) {
739741
if ( ! isset( $this->_screen_reader_content[ $key ] ) ) {
@@ -949,8 +951,9 @@ public function render_screen_meta() {
949951
if ( $this->get_option( 'layout_columns' ) ) {
950952
$this->columns = (int) get_user_option( "screen_layout_$this->id" );
951953

952-
if ( ! $this->columns && $this->get_option( 'layout_columns', 'default' ) ) {
953-
$this->columns = $this->get_option( 'layout_columns', 'default' );
954+
$layout_columns = (int) $this->get_option( 'layout_columns', 'default' );
955+
if ( ! $this->columns && $layout_columns ) {
956+
$this->columns = $layout_columns;
954957
}
955958
}
956959
$GLOBALS['screen_layout_columns'] = $this->columns; // Set the global for back-compat.

src/wp-admin/includes/image.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,13 @@ function wp_read_image_metadata( $file ) {
827827
return false;
828828
}
829829

830-
list( , , $image_type ) = wp_getimagesize( $file );
830+
$image_size = wp_getimagesize( $file );
831+
832+
if ( false === $image_size ) {
833+
return false;
834+
}
835+
836+
list( , , $image_type ) = $image_size;
831837

832838
/*
833839
* EXIF contains a bunch of data we'll probably never need formatted in ways

src/wp-admin/includes/media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ function media_upload_form( $errors = null ) {
22852285
_ex( 'Upload', 'verb' );
22862286
?>
22872287
</label>
2288-
<input type="file" name="async-upload" id="async-upload" required />
2288+
<input type="file" name="async-upload" id="async-upload" />
22892289
<?php submit_button( _x( 'Upload', 'verb' ), 'primary', 'html-upload', false ); ?>
22902290
<a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e( 'Cancel' ); ?></a>
22912291
</p>

src/wp-admin/includes/taxonomy.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ function get_category_to_edit( $id ) {
4848
*
4949
* @since 2.0.0
5050
*
51-
* @param int|string $cat_name Category name.
52-
* @param int $category_parent Optional. ID of parent category.
53-
* @return int|WP_Error
51+
* @param string $category_name Category name.
52+
* @param int $category_parent Optional. ID of parent category.
53+
* @return int The ID of category term on success, or zero on failure.
5454
*/
55-
function wp_create_category( $cat_name, $category_parent = 0 ) {
56-
$id = category_exists( $cat_name, $category_parent );
55+
function wp_create_category( $category_name, $category_parent = 0 ) {
56+
$id = category_exists( $category_name, $category_parent );
5757
if ( $id ) {
58-
return $id;
58+
return (int) $id;
5959
}
6060

6161
return wp_insert_category(
6262
array(
63-
'cat_name' => $cat_name,
63+
'cat_name' => $category_name,
6464
'category_parent' => $category_parent,
6565
)
6666
);

src/wp-admin/network/sites.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240
<?php
241241
require_once ABSPATH . 'wp-admin/admin-footer.php';
242242
exit;
243-
break;
243+
// By exiting, there's no longer a switch to break out of.
244244

245245
case 'spam':
246246
case 'notspam':

0 commit comments

Comments
 (0)