Skip to content

Commit 3142ead

Browse files
committed
Merge branch 'trunk' into fix/issue-64274
2 parents 84c2bd9 + 76a8f03 commit 3142ead

Some content is hidden

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

55 files changed

+1319
-506
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/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/meta-boxes.php

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,25 +1677,31 @@ function register_and_do_post_meta_boxes( $post ) {
16771677
*
16781678
* @since 3.0.0
16791679
*
1680-
* @param string $post_type Post type.
1681-
* @param WP_Post $post Post object.
1680+
* @param string $object_type The type of the current object that meta boxes were added to.
1681+
* Can be 'post', 'page', custom post types, 'comment', or 'link'.
1682+
* @param WP_Post|WP_Comment|object $object The post, comment, or link object. Type varies depending on
1683+
* `$object_type`.
16821684
*/
16831685
do_action( 'add_meta_boxes', $post_type, $post );
16841686

16851687
/**
16861688
* Fires after all built-in meta boxes have been added, contextually for the given post type.
16871689
*
1688-
* The dynamic portion of the hook name, `$post_type`, refers to the post type of the post.
1690+
* The dynamic portion of the hook name, `$post_type`, refers to the post type of the post,
1691+
* or the object type (comment, link).
16891692
*
16901693
* Possible hook names include:
16911694
*
16921695
* - `add_meta_boxes_post`
16931696
* - `add_meta_boxes_page`
16941697
* - `add_meta_boxes_attachment`
1698+
* - `add_meta_boxes_comment`
1699+
* - `add_meta_boxes_link`
16951700
*
16961701
* @since 3.0.0
16971702
*
1698-
* @param WP_Post $post Post object.
1703+
* @param WP_Post|WP_Comment|object $object The post, comment, or link object. Type varies depending on
1704+
* the hook name.
16991705
*/
17001706
do_action( "add_meta_boxes_{$post_type}", $post );
17011707

@@ -1706,11 +1712,11 @@ function register_and_do_post_meta_boxes( $post ) {
17061712
*
17071713
* @since 3.0.0
17081714
*
1709-
* @param string $post_type Post type of the post on Edit Post screen, 'link' on Edit Link screen,
1710-
* 'dashboard' on Dashboard screen.
1711-
* @param string $context Meta box context. Possible values include 'normal', 'advanced', 'side'.
1712-
* @param WP_Post|object|string $post Post object on Edit Post screen, link object on Edit Link screen,
1713-
* an empty string on Dashboard screen.
1715+
* @param string $object_type Post type of the post on Edit Post screen, 'link' on Edit Link screen,
1716+
* 'dashboard' on Dashboard screen.
1717+
* @param string $context Meta box context. Possible values include 'normal', 'advanced', 'side'.
1718+
* @param WP_Post|object|string $object Post object on Edit Post screen, link object on Edit Link screen,
1719+
* an empty string on Dashboard screen.
17141720
*/
17151721
do_action( 'do_meta_boxes', $post_type, 'normal', $post );
17161722
/** This action is documented in wp-admin/includes/meta-boxes.php */

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':

src/wp-admin/upload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function () {
180180
'content' =>
181181
'<p>' . __( 'All the files you&#8217;ve uploaded are listed in the Media Library, with the most recent uploads listed first.' ) . '</p>' .
182182
'<p>' . __( 'You can view your media in a simple visual grid or a list with columns. Switch between these views using the icons to the left above the media.' ) . '</p>' .
183-
'<p>' . __( 'To delete media items, click the Bulk Select button at the top of the screen. Select any items you wish to delete, then click the Delete Selected button. Clicking the Cancel Selection button takes you back to viewing your media.' ) . '</p>',
183+
'<p>' . __( 'To delete media items, click the <strong>Bulk select</strong> button at the top of the screen. Select any items you wish to delete, then click the <strong>Delete permanently</strong> button. Clicking the <strong>Cancel</strong> button takes you back to viewing your media.' ) . '</p>',
184184
)
185185
);
186186

src/wp-content/themes/twentyeleven/functions.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,9 @@ function twentyeleven_skip_link() {
988988
*
989989
* Added for backward compatibility to support pre-6.0.0 WordPress versions.
990990
*
991-
* @since 6.0.0
991+
* @since Twenty Eleven 4.1
992+
*
993+
* @return string Locale-specific list item separator.
992994
*/
993995
function wp_get_list_item_separator() {
994996
/* translators: Used between list items, there is a space after the comma. */

0 commit comments

Comments
 (0)