Skip to content

Commit 2a89d49

Browse files
authored
Merge branch 'trunk' into fix/64130-wpdb-load-col-info-type-check
2 parents aab7aa7 + f8b9634 commit 2a89d49

133 files changed

Lines changed: 4995 additions & 899 deletions

File tree

Some content is hidden

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

‎Gruntfile.js‎

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,21 +1716,21 @@ module.exports = function(grunt) {
17161716
grunt.loadNpmTasks( 'grunt-webpack' );
17171717

17181718
// RTL task.
1719-
grunt.registerTask('rtl', ['rtlcss:core', 'rtlcss:colors']);
1719+
grunt.registerTask('rtl', 'Generates right-to-left (RTL) stylesheets for core and the admin color schemes.', ['rtlcss:core', 'rtlcss:colors']);
17201720

17211721
// Color schemes task.
1722-
grunt.registerTask('colors', ['sass:colors', 'postcss:colors']);
1722+
grunt.registerTask('colors', 'Compiles and processes the admin color scheme stylesheets.', ['sass:colors', 'postcss:colors']);
17231723

17241724
// JSHint task.
1725-
grunt.registerTask( 'jshint:corejs', [
1725+
grunt.registerTask( 'jshint:corejs', 'Runs JSHint on the Gruntfile, tests, bundled themes, and core JavaScript files.', [
17261726
'jshint:grunt',
17271727
'jshint:tests',
17281728
'jshint:themes',
17291729
'jshint:core',
17301730
'jshint:media'
17311731
] );
17321732

1733-
grunt.registerTask( 'restapi-jsclient', [
1733+
grunt.registerTask( 'restapi-jsclient', 'Runs the PHPUnit and QUnit tests for the REST API JavaScript client.', [
17341734
'phpunit:restapi-jsclient',
17351735
'qunit:compiled'
17361736
] );
@@ -1789,7 +1789,7 @@ module.exports = function(grunt) {
17891789

17901790
grunt.renameTask( 'watch', '_watch' );
17911791

1792-
grunt.registerTask( 'watch', function() {
1792+
grunt.registerTask( 'watch', 'Watches files for changes and runs the related tasks. Use watch:phpunit or --phpunit to also run PHPUnit tests.', function() {
17931793
if ( ! this.args.length || this.args.indexOf( 'webpack' ) > -1 ) {
17941794
grunt.task.run( 'build' );
17951795
}
@@ -1806,11 +1806,11 @@ module.exports = function(grunt) {
18061806

18071807
grunt.registerMultiTask( 'imagemin', 'Losslessly optimizes PNG, JPEG and GIF images.', require( './tools/imagemin/task.js' )( grunt ) );
18081808

1809-
grunt.registerTask( 'precommit:image', [
1809+
grunt.registerTask( 'precommit:image', 'Optimizes core images in preparation for a commit.', [
18101810
'imagemin:core'
18111811
] );
18121812

1813-
grunt.registerTask( 'precommit:js', [
1813+
grunt.registerTask( 'precommit:js', 'Builds, lints, type checks, and tests JavaScript files in preparation for a commit.', [
18141814
'webpack:prod',
18151815
'jshint:corejs',
18161816
'lint:jsdoc',
@@ -1823,16 +1823,16 @@ module.exports = function(grunt) {
18231823
'qunit:compiled'
18241824
] );
18251825

1826-
grunt.registerTask( 'precommit:css', [
1826+
grunt.registerTask( 'precommit:css', 'Processes core CSS files with PostCSS in preparation for a commit.', [
18271827
'postcss:core'
18281828
] );
18291829

1830-
grunt.registerTask( 'precommit:php', [
1830+
grunt.registerTask( 'precommit:php', 'Runs PHPStan and PHPUnit tests in preparation for a commit.', [
18311831
'phpstan',
18321832
'phpunit'
18331833
] );
18341834

1835-
grunt.registerTask( 'precommit:emoji', [
1835+
grunt.registerTask( 'precommit:emoji', 'Updates the emoji regular expressions from the latest Twemoji file list. Requires the GitHub CLI.', [
18361836
'replace:emoji-regex'
18371837
] );
18381838

@@ -1972,14 +1972,14 @@ module.exports = function(grunt) {
19721972
}
19731973
} );
19741974

1975-
grunt.registerTask( 'copy:js', [
1975+
grunt.registerTask( 'copy:js', 'Copies JavaScript files from npm packages, vendor libraries, wp-admin, and wp-includes.', [
19761976
'copy:npm-packages',
19771977
'copy:vendor-js',
19781978
'copy:admin-js',
19791979
'copy:includes-js'
19801980
] );
19811981

1982-
grunt.registerTask( 'uglify:all', [
1982+
grunt.registerTask( 'uglify:all', 'Minifies all JavaScript files.', [
19831983
'uglify:core',
19841984
'uglify:emoji-loader',
19851985
'uglify:jquery-ui',
@@ -1990,20 +1990,20 @@ module.exports = function(grunt) {
19901990
'uglify:wp-polyfill-fetch'
19911991
] );
19921992

1993-
grunt.registerTask( 'build:codemirror', [
1993+
grunt.registerTask( 'build:codemirror', 'Builds the CodeMirror script and styles.', [
19941994
'webpack:codemirror',
19951995
'cssmin:codemirror',
19961996
'usebanner:codemirror',
19971997
'copy:codemirror'
19981998
] );
19991999

2000-
grunt.registerTask( 'build:webpack', [
2000+
grunt.registerTask( 'build:webpack', 'Cleans the webpack assets and runs the production and development webpack builds.', [
20012001
'clean:webpack-assets',
20022002
'webpack:prod',
20032003
'webpack:dev',
20042004
] );
20052005

2006-
grunt.registerTask( 'build:js', [
2006+
grunt.registerTask( 'build:js', 'Builds all JavaScript files.', [
20072007
'clean:js',
20082008
'build:webpack',
20092009
'copy:js',
@@ -2013,7 +2013,7 @@ module.exports = function(grunt) {
20132013
'concat:emoji'
20142014
] );
20152015

2016-
grunt.registerTask( 'build:css', [
2016+
grunt.registerTask( 'build:css', 'Builds all CSS files, including the RTL and admin color scheme stylesheets.', [
20172017
'clean:css',
20182018
'copy:wp-admin-css-compat-rtl',
20192019
'copy:wp-admin-css-compat-min',
@@ -2104,38 +2104,38 @@ module.exports = function(grunt) {
21042104
} );
21052105
} );
21062106

2107-
grunt.registerTask( 'build:certificates', [
2107+
grunt.registerTask( 'build:certificates', 'Copies the certificate authority bundle into wp-includes.', [
21082108
'copy:certificates'
21092109
] );
21102110

2111-
grunt.registerTask( 'certificates:upgrade', [
2111+
grunt.registerTask( 'certificates:upgrade', 'Upgrades the certificate authority bundle package and copies the bundle into wp-includes.', [
21122112
'certificates:upgrade-package',
21132113
'copy:certificates'
21142114
] );
21152115

2116-
grunt.registerTask( 'build:files', [
2116+
grunt.registerTask( 'build:files', 'Cleans the build directory and copies the core files into it.', [
21172117
'clean:files',
21182118
'copy:files',
21192119
'copy:version',
21202120
] );
21212121

2122-
grunt.registerTask( 'replace:workflow-references-local-to-remote', [
2122+
grunt.registerTask( 'replace:workflow-references-local-to-remote', 'Replaces local reusable workflow references with references to trunk.', [
21232123
'copy:workflow-references-local-to-remote',
21242124
]);
21252125

2126-
grunt.registerTask( 'replace:workflow-references-remote-to-local', [
2126+
grunt.registerTask( 'replace:workflow-references-remote-to-local', 'Replaces reusable workflow references to trunk with local references.', [
21272127
'copy:workflow-references-remote-to-local',
21282128
]);
21292129

2130-
grunt.registerTask( 'post-branching', [
2130+
grunt.registerTask( 'post-branching', 'Removes unneeded workflows and points reusable workflow references to trunk after branching.', [
21312131
'clean:workflows',
21322132
'replace:workflow-references-local-to-remote'
21332133
]);
21342134

21352135
/**
21362136
* Build verification tasks.
21372137
*/
2138-
grunt.registerTask( 'verify:build', [
2138+
grunt.registerTask( 'verify:build', 'Runs all build verification tasks.', [
21392139
'verify:old-files',
21402140
'verify:source-maps',
21412141
] );
@@ -2145,7 +2145,7 @@ module.exports = function(grunt) {
21452145
*
21462146
* @ticket 36083
21472147
*/
2148-
grunt.registerTask( 'verify:old-files', function() {
2148+
grunt.registerTask( 'verify:old-files', 'Verifies that no files listed in $_old_files exist in the build directory.', function() {
21492149
const file = `${ BUILD_DIR }wp-admin/includes/update-core.php`;
21502150

21512151
assert(
@@ -2205,7 +2205,7 @@ module.exports = function(grunt) {
22052205
* @ticket 46218
22062206
* @ticket 60348
22072207
*/
2208-
grunt.registerTask( 'verify:source-maps', function() {
2208+
grunt.registerTask( 'verify:source-maps', 'Verifies that built JavaScript files do not contain source map links.', function() {
22092209
const ignoredFiles = [
22102210
'build/wp-includes/js/dist/components.js',
22112211
'build/wp-includes/js/dist/data.js',
@@ -2291,7 +2291,7 @@ module.exports = function(grunt) {
22912291
} );
22922292

22932293
// Detects and copies stable routes.
2294-
grunt.registerTask( 'build:routes', [
2294+
grunt.registerTask( 'build:routes', 'Detects and copies the stable Gutenberg routes.', [
22952295
'routes:setup',
22962296
'copy:routes',
22972297
] );
@@ -2303,7 +2303,7 @@ module.exports = function(grunt) {
23032303
*
23042304
* Because all of these tasks write to src/, the outcome is identical for build and build:dev.
23052305
*/
2306-
grunt.registerTask( 'build:gutenberg', [
2306+
grunt.registerTask( 'build:gutenberg', 'Refreshes the Gutenberg-sourced content in src/.', [
23072307
'clean:gutenberg',
23082308
'copy:gutenberg-php',
23092309
'build:routes',
@@ -2316,7 +2316,7 @@ module.exports = function(grunt) {
23162316
'copy:icon-library-manifest',
23172317
] );
23182318

2319-
grunt.registerTask( 'build', function() {
2319+
grunt.registerTask( 'build', 'Builds WordPress. Use --dev to build into src/ for development.', function() {
23202320
if ( grunt.option( 'dev' ) ) {
23212321
grunt.task.run( [
23222322
'gutenberg:verify',
@@ -2341,7 +2341,7 @@ module.exports = function(grunt) {
23412341
}
23422342
} );
23432343

2344-
grunt.registerTask( 'prerelease', [
2344+
grunt.registerTask( 'prerelease', 'Runs formatting checks, linting, tests, and image optimization in preparation for a release.', [
23452345
'format:php:error',
23462346
'precommit:php',
23472347
'precommit:js',
@@ -2482,7 +2482,7 @@ module.exports = function(grunt) {
24822482
grunt.registerTask('apply', 'patch');
24832483

24842484
// Default task.
2485-
grunt.registerTask('default', ['build']);
2485+
grunt.registerTask('default', 'Runs the build task.', ['build']);
24862486

24872487
/*
24882488
* Automatically updates the `:dynamic` configurations

‎package-lock.json‎

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"@wordpress/scripts": "33.0.0",
5656
"autoprefixer": "10.5.3",
5757
"chalk": "5.6.2",
58-
"check-node-version": "4.2.1",
5958
"cssnano": "7.1.9",
6059
"dotenv": "17.4.2",
6160
"dotenv-expand": "13.0.0",

‎phpstan.neon.dist‎

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ includes:
3333
- tests/phpstan/baselines/booleanNot.alwaysTrue.neon
3434
- tests/phpstan/baselines/booleanOr.alwaysFalse.neon
3535
- tests/phpstan/baselines/booleanOr.alwaysTrue.neon
36-
- tests/phpstan/baselines/catch.neverThrown.neon
3736
- tests/phpstan/baselines/class.notFound.neon
3837
- tests/phpstan/baselines/deadCode.unreachable.neon
3938
- tests/phpstan/baselines/empty.offset.neon
@@ -42,8 +41,6 @@ includes:
4241
- tests/phpstan/baselines/function.alreadyNarrowedType.neon
4342
- tests/phpstan/baselines/function.impossibleType.neon
4443
- tests/phpstan/baselines/function.resultUnused.neon
45-
- tests/phpstan/baselines/greater.alwaysTrue.neon
46-
- tests/phpstan/baselines/greaterOrEqual.alwaysFalse.neon
4744
- tests/phpstan/baselines/greaterOrEqual.alwaysTrue.neon
4845
- tests/phpstan/baselines/identical.alwaysFalse.neon
4946
- tests/phpstan/baselines/identical.alwaysTrue.neon
@@ -65,7 +62,6 @@ includes:
6562
- tests/phpstan/baselines/property.defaultValue.neon
6663
- tests/phpstan/baselines/property.nonObject.neon
6764
- tests/phpstan/baselines/property.notFound.neon
68-
- tests/phpstan/baselines/property.phpDocType.neon
6965
- tests/phpstan/baselines/property.private.neon
7066
- tests/phpstan/baselines/property.protected.neon
7167
- tests/phpstan/baselines/return.type.neon
@@ -152,3 +148,44 @@ parameters:
152148
message: '#^Parameter \#4 \$length of function substr_compare expects int, null given\.$#'
153149
path: src/wp-includes/html-api/class-wp-html-tag-processor.php
154150
reportUnmatched: false
151+
152+
# HTML API:
153+
# These errors are ignored for the sake of making it easier to keep the HTML Processor in sync with the HTML spec.
154+
-
155+
message: '#^Comparison operation "\>" between 999\|1000 and 0 is always true\.$#'
156+
identifier: greater.alwaysTrue
157+
count: 1
158+
path: src/wp-includes/html-api/class-wp-html-processor.php
159+
-
160+
message: '#^Comparison operation "\>\=" between 0 and 8 is always false\.$#'
161+
identifier: greaterOrEqual.alwaysFalse
162+
count: 1
163+
path: src/wp-includes/html-api/class-wp-html-processor.php
164+
-
165+
message: '#^Left side of && is always true\.$#'
166+
identifier: booleanAnd.leftAlwaysTrue
167+
count: 1
168+
path: src/wp-includes/html-api/class-wp-html-processor.php
169+
-
170+
message: '#^Unreachable statement \- code above always terminates\.$#'
171+
identifier: deadCode.unreachable
172+
count: 15
173+
path: src/wp-includes/html-api/class-wp-html-processor.php
174+
-
175+
message: '#^If condition is always true\.$#'
176+
identifier: if.alwaysTrue
177+
count: 2
178+
path: src/wp-includes/html-api/class-wp-html-processor.php
179+
-
180+
message: '#^Dead catch \- Exception is never thrown in the try block\.$#'
181+
identifier: catch.neverThrown
182+
count: 1
183+
path: src/wp-includes/html-api/class-wp-html-processor.php
184+
-
185+
# The early return at the start of step() narrows $last_error to null, and PHPStan does not see that
186+
# bookmark_token() sets it to ERROR_EXCEEDED_MAX_BOOKMARKS before throwing. So it reports that the
187+
# check in the catch block can never match, when in fact it always does.
188+
message: '#^Strict comparison using \=\=\= between ''exceeded\-max…'' and null will always evaluate to false\.$#'
189+
identifier: identical.alwaysFalse
190+
count: 1
191+
path: src/wp-includes/html-api/class-wp-html-processor.php

‎src/js/_enqueues/admin/common.js‎

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,17 +1075,6 @@ $( function() {
10751075
});
10761076
}
10771077

1078-
/*
1079-
* The `.below-h2` class is here just for backward compatibility with plugins
1080-
* that are (incorrectly) using it. Do not use. Use `.inline` instead. See #34570.
1081-
* If '.wp-header-end' is found, append the notices after it otherwise
1082-
* after the first h1 or h2 heading found within the main content.
1083-
*/
1084-
if ( ! $headerEnd.length ) {
1085-
$headerEnd = $( '.wrap h1, .wrap h2' ).first();
1086-
}
1087-
$( 'div.updated, div.error, div.notice' ).not( '.inline, .below-h2' ).insertAfter( $headerEnd );
1088-
10891078
/**
10901079
* Makes notices dismissible.
10911080
*
@@ -1525,6 +1514,32 @@ $( function() {
15251514
input.on('change', toggleUploadButton);
15261515
})();
15271516

1517+
/**
1518+
* Moves the admin notices into an `aside` element after the first `h1`.
1519+
* Prior to 7.2.0, admin notices were only moved after the first `h1`;
1520+
* The `aside` wrapper was added in 7.2.0.
1521+
*
1522+
* @since 7.2.0
1523+
*
1524+
* @return {void}
1525+
*/
1526+
function moveAdminNotices() {
1527+
/*
1528+
* The `.below-h2` class is here just for backward compatibility with plugins
1529+
* that are (incorrectly) using it. Do not use. Use `.inline` instead. See #34570.
1530+
* If '.wp-header-end' is found, append the notices after it otherwise
1531+
* after the first h1 or h2 heading found within the main content.
1532+
*/
1533+
if ( ! $headerEnd.length ) {
1534+
$headerEnd = $( '.wrap h1, .wrap h2' ).first();
1535+
}
1536+
const $notices = $( 'div.updated, div.error, div.notice' ).not( '.inline, .below-h2' );
1537+
if ( $notices.length ) {
1538+
const $wpAdminNotices = $( '<aside id="wp-admin-notices"></aside>' ).attr( 'aria-label', __( 'Admin Notices' ) ).insertAfter( $headerEnd );
1539+
$notices.appendTo( $wpAdminNotices );
1540+
}
1541+
}
1542+
15281543
/**
15291544
* Pins the menu while distraction-free writing is enabled.
15301545
*
@@ -1843,7 +1858,7 @@ $( function() {
18431858
$document.on( 'postbox-toggled', this.maybeDisableSortables );
18441859

18451860
// When the screen columns are changed, potentially disable sortables.
1846-
$( '#screen-options-wrap input' ).on( 'click', this.maybeDisableSortables );
1861+
$( '#screen-options-wrap input:not(.meta-box-reordering-toggle)' ).on( 'click', this.maybeDisableSortables );
18471862
},
18481863

18491864
/**
@@ -1857,6 +1872,7 @@ $( function() {
18571872
var width = navigator.userAgent.indexOf('AppleWebKit/') > -1 ? $window.width() : window.innerWidth;
18581873

18591874
if (
1875+
$body.hasClass( 'meta-box-reordering-disabled' ) ||
18601876
( width <= 782 ) ||
18611877
( 1 >= $sortables.find( '.ui-sortable-handle:visible' ).length && jQuery( '.columns-prefs-1 input' ).prop( 'checked' ) )
18621878
) {
@@ -2127,6 +2143,7 @@ $( function() {
21272143
});
21282144

21292145
window.wpResponsive.init();
2146+
moveAdminNotices();
21302147
setPinMenu();
21312148
setMenuState();
21322149
makeNoticesDismissible();

0 commit comments

Comments
 (0)