Skip to content

[pull] trunk from WordPress:trunk - #10

Open
pull[bot] wants to merge 6107 commits into
kowsar89:trunkfrom
WordPress:trunk
Open

[pull] trunk from WordPress:trunk#10
pull[bot] wants to merge 6107 commits into
kowsar89:trunkfrom
WordPress:trunk

Conversation

@pull

@pull pull Bot commented Feb 20, 2023

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

Sergey Biryukov and others added 25 commits August 2, 2026 23:48
…ith booleans.

Using the dedicated boolean assertions clarifies intent and produces more descriptive failure messages.

Follow-up to [51453].

Props Soean, mukesh27.
See #64894.

git-svn-id: https://develop.svn.wordpress.org/trunk@62969 602fd350-edb4-49c9-b593-d223f7449a82
Props oandregal, ntsekouras.
See #65577.


git-svn-id: https://develop.svn.wordpress.org/trunk@62970 602fd350-edb4-49c9-b593-d223f7449a82
Removes a duplicate `@param` tag carrying an outdated type and restores the description of the returned value. 

Developed in: #12791

Follow-up to [61603].

Props bejignesh, mukesh27,  wildworks.
See #64896.

git-svn-id: https://develop.svn.wordpress.org/trunk@62971 602fd350-edb4-49c9-b593-d223f7449a82
When installing a theme from the Details & Preview overlay, the animated icon shown in the Install button was taller than the button itself, so the button grew and its label shifted while the install was in progress. Matching the icon height to the button height keeps the button at a stable size and the icon aligned with the label throughout the updating and updated states.

Developed in: #12799

Follow-up to [62516].

Props eishanoor, kosvrouvas, mosescursor, r1k0, shailu25, ugyensupport, vedantere, wildworks.
Fixes #65601.

git-svn-id: https://develop.svn.wordpress.org/trunk@62972 602fd350-edb4-49c9-b593-d223f7449a82
The `search` and `page` parameters source of truth is the URL,
and cannot be configured via the filters.

Props oandregal, ntsekouras, jorgefilipecosta.
Fixes #65577.



git-svn-id: https://develop.svn.wordpress.org/trunk@62973 602fd350-edb4-49c9-b593-d223f7449a82
[62891] introduced the ability to override the runner used for a GitHub Actions job using a repository or organization variable. While initially named `PHPUNIT_RUNNER`, overriding the runner for a specific job could be useful in more situations.

This renames the variable chacked to `RUNNER_GROUP`.

Fixes #65749.

git-svn-id: https://develop.svn.wordpress.org/trunk@62974 602fd350-edb4-49c9-b593-d223f7449a82
This is a maintenance and minor security release.

References:
* [https://github.com/PHPMailer/PHPMailer/releases/tag/v7.1.1 PHPMailer 7.1.1 release notes]
* [https://github.com/PHPMailer/PHPMailer/releases/tag/v7.1.0 PHPMailer 7.1.0 release notes]
* [PHPMailer/PHPMailer@v7.0.2...v7.1.1 Full list of changes in PHPMailer 7.1.1]

Follow-up to [54937], [55557], [56484], [57137], [59246], [59481], [60623], [60813], [60888], [61249], [61468].

Props hareesh-pillai, Synchro, jrf.
Fixes #65790.

git-svn-id: https://develop.svn.wordpress.org/trunk@62975 602fd350-edb4-49c9-b593-d223f7449a82
The list and grid filter panels had different padding following [61757]. This is an undesirable difference, and should be equalized. Apply scoped padding to match the two filter bars.

Developed in #12664

Props afercia, softglaze, khokansardar, joedolson.
Fixes #65697.

git-svn-id: https://develop.svn.wordpress.org/trunk@62976 602fd350-edb4-49c9-b593-d223f7449a82
While the intention was to only render the On This Day widget when it returned results, this proved to create a variety of implementation complications and some significant points of confusion for users.

Remove the conditional rendering of the On This Day widget. When active without posts, display a message inviting the user to publish a new post.

Developed in #12575

Props iamchitti, mirmpro, shailu25, ugyensupport, iamraju, nazmulasif, wildworks, joedolson, mukesh27, annezazu, paaljoachim, joen.
Fixes #65647.

git-svn-id: https://develop.svn.wordpress.org/trunk@62977 602fd350-edb4-49c9-b593-d223f7449a82
The stored `filesize` attachment metadata was read without validation in `wp_prepare_attachment_for_js()` and `attachment_submitbox_metadata()`. Attachment metadata is untyped, and the `filesize` key is commonly written by offloading plugins from a remote storage API response, so it can arrive as a numeric string, or be empty, non-numeric, or negative when the remote lookup fails. A numeric string was passed through verbatim, making `filesizeInBytes` a string in the media modal while the `wp_filesize()` branch of the very same conditional yielded an `int`; a non-numeric value such as `'unknown'` was truthy and suppressed the fallback entirely, so `size_format()` returned `false` and the file size rendered empty even when the real file was readable.

Both call sites now only trust the stored value when it is numeric and casts to an integer greater than zero, and otherwise recompute the size with `wp_filesize()`. The fallback condition also replaces `file_exists()` with `is_readable()` guarded on a non-empty string, since `get_attached_file()` can be filtered to return a non-string. PHPUnit coverage is added for both functions.

Developed in #12632.
Follow-up to r34258, r52837, r62813, r62815.

Props mukesh27, westonruter.
See #65670.
Fixes #65686.


git-svn-id: https://develop.svn.wordpress.org/trunk@62978 602fd350-edb4-49c9-b593-d223f7449a82
The On This Day dashboard widget has been bumped from the WordPress 7.1 release to the 7.2 release pending design and behavioural improvements.

This reverts r62977, r62968, r62852, r62681.

Props annezazu, matt, peterwilsoncc.
Fixes #65801.



git-svn-id: https://develop.svn.wordpress.org/trunk@63001 602fd350-edb4-49c9-b593-d223f7449a82
Attachment metadata is untyped, and the `sizes` key is not guaranteed to be present or to hold an array. Sub-size generation can leave it out entirely, and a plugin filtering `wp_get_attachment_metadata` can replace it with anything. `wp_save_image()` validated only that the metadata itself was an array before passing `$meta['sizes']` to `array_merge()`, so an absent or scalar value raised a `TypeError` and the image editor returned an HTTP 500 mid-save. `wp_restore_image()` had the same gap at `$meta['sizes'][ $default_size ] = $data`, where a string raises "Cannot use a scalar value as an array" and `false` is deprecated as of PHP 8.1 and an error as of PHP 9.

`wp_get_attachment_metadata()` now returns `false` whenever the metadata is not an array, on the `$unfiltered` path as well as after the filter, matching the documented `array|false` return. A `sizes` key holding a non-array is replaced with an empty array, so every caller can rely on the key being an array whenever it is present. The key is not invented when it is absent: audio, video and document attachments legitimately store metadata without it, and callers such as `wp-admin/post.php` read the metadata unfiltered in order to modify it and write it back, so normalizing there would persist into the database.

The image editor entry points fill in the missing key themselves, and `wp_prepare_attachment_for_js()` now checks the dimensions of the `full` entry alongside its filename before reading them, removing the "Undefined array key" warnings raised for a `sizes` array that carries no usable `full` size. PHPUnit coverage is added for all three functions.

Developed in #12744.
Follow-up to r11965, r23873, r38949, r49084, r62978.

Props josephscott, westonruter, mukesh27, irozum, ugyensupport, nazmulasif.
See #65686, #64898.
Fixes #65748.


git-svn-id: https://develop.svn.wordpress.org/trunk@63002 602fd350-edb4-49c9-b593-d223f7449a82
This changes `RUNNER_GROUP` to `RUNNERS_NAME` to avoid confusion with the `runs-on.group` setting, which is configured in a completely different way.

Props lancewillet.
See #65749.

git-svn-id: https://develop.svn.wordpress.org/trunk@63003 602fd350-edb4-49c9-b593-d223f7449a82
The `suggest` section had accumulated only four extensions, added ad hoc as individual changes happened to need them. It now lists every extension that the Hosting handbook's server environment page [https://make.wordpress.org/hosting/handbook/server-environment/#required-extensions identifies] as required, highly recommended, or suggested. This lets development environments be provisioned to match what core actually expects, and gives IDEs an accurate picture of which functions are available.

The `require` section is deliberately left unchanged: the `mysqli` extension stays a suggestion rather than a requirement since a `db.php` drop-in can supply the database layer without it.

Developed in #12384.
Follow-up to r56687, r62529, r62637.

Fixes #65571.


git-svn-id: https://develop.svn.wordpress.org/trunk@63004 602fd350-edb4-49c9-b593-d223f7449a82
…rtNotIXRError`.

See #64898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63005 602fd350-edb4-49c9-b593-d223f7449a82
Passing anything other than a struct as the fourth argument caused a fatal error, and because the struct was read before the login was attempted, an unauthenticated request was enough to trigger it.

Read and validate the struct only once the request is authenticated and the `upload_files` capability is confirmed, as every other method on the server does, and reject a call with too few arguments using `minimum_args()`. The `name`, `type` and `bits` members must all be strings: a struct sent for `bits` reached `fwrite()` by way of `wp_upload_bits()` and threw a `TypeError`, while one sent for `type` survived `sanitize_mime_type()` to reach the database as the attachment's post MIME type. A `name` left empty by `sanitize_file_name()` is now reported as a malformed request too, rather than as the server failure `wp_upload_bits()` produced for it.

The fourth argument is expanded into a nested hash in the documentation, covering the previously undocumented `post_id` member. Tests cover each rejected shape, the optional members that remain tolerated when absent, and the ordering of the login and capability checks ahead of the validation.

Developed in #12482.
Follow-up to r32579, r53881.

Props josephscott, westonruter, mukesh27.
See #65600.
Fixes #65611.


git-svn-id: https://develop.svn.wordpress.org/trunk@63006 602fd350-edb4-49c9-b593-d223f7449a82
The media editor modal rendered without its intended styles, because the stylesheet it relies on was never registered in core. Registering the handle makes the modal display as intended.

Developed in #12813

Props afercia, andrewserong, gulamdastgir04, mdridipu, ramonopoly, softglaze, wildworks.
Fixes #65794.

git-svn-id: https://develop.svn.wordpress.org/trunk@63007 602fd350-edb4-49c9-b593-d223f7449a82
…otice.

Follow-up to [https://mu.trac.wordpress.org/changeset/1968 mu:1968], [https://mu.trac.wordpress.org/changeset/2005 mu:2005], [13590].

Props bor0, realloc.
Fixes #65792.

git-svn-id: https://develop.svn.wordpress.org/trunk@63008 602fd350-edb4-49c9-b593-d223f7449a82
- Updates the toolbar items styling by adding a more prominent focus indicator.
- Adjusts label and icon coloring selectors (including mobile-specific focus states).
- Refines the 'Howdy menu' dropdown layout and focus styles.
- Tweaks the responsive menu toggle item sizing.

Props afercia, joedolson, sabernhardt, khokansardar, jns141191, iamraju, sukhendu2002, shamimmoeen, ugyensupport.
Fixes #65445.
Fixes #65765.


git-svn-id: https://develop.svn.wordpress.org/trunk@63009 602fd350-edb4-49c9-b593-d223f7449a82
Adjust styling on privacy export and erasure tables for compatibility with the list table column changes in [62839]. 

Update the colors used to highlight confirmed or failed privacy requests following the admin color scheme changes in WordPress 7.0.

Developed in #12803

Props r1k0, joedolson, masteradhoc, shailu25.
Fixes #65787.

git-svn-id: https://develop.svn.wordpress.org/trunk@63010 602fd350-edb4-49c9-b593-d223f7449a82
The margins were set to `0` for all inputs in the request form, breaking the alignment for the checkbox.

Limit margin resetting to inputs of type text. Change labeling from implicit to explicit labelling, to better support voice control users.

Developed in #11841

Props soyebsalar01, suryakantupadhyay, deepakprajapati, audrasjb, joedolson, adrianduffell, mukesh27, wildworks, masteradhoc.
Fixes #65246.

git-svn-id: https://develop.svn.wordpress.org/trunk@63011 602fd350-edb4-49c9-b593-d223f7449a82
Introduce `wp_notify_note_mentions()` on `rest_insert_comment`, alongside the existing post author notification, which parses those IDs out of the saved note and emails each mentioned user in their own locale with a link back to the post editor.

Recipients are limited to users who can `edit_comment` the note, matching `WP_REST_Comments_Controller::check_read_permission()`, so an email cannot carry note content to someone who cannot see the note in the editor. The note's own author is skipped, as is the post author, who `wp_new_comment_via_rest_notify_postauthor()` already notifies about every note. Only note creation notifies, and the existing `wp_notes_notify` option turns the whole path off.

See related Gutenberg pull request: WordPress/gutenberg#79606.

Follow-up to [62832].

Props westonruter, mamaduka.
Fixes #65639.



git-svn-id: https://develop.svn.wordpress.org/trunk@63012 602fd350-edb4-49c9-b593-d223f7449a82
When a HEIC upload fails, the Media Library reported that "This image cannot be displayed in a web browser." That has not been accurate since [48288] introduced the string: Safari and other browsers render HEIC fine, and because the same message is sent to every browser it cannot describe what the visitor's own browser supports.

The upload fails because the server's image editor cannot process the `image/heic` mime type, so the file is never converted to a web safe format - servers that do support HEIC convert it to JPEG, as of [58849]. Reword the message to name that cause and keep the existing suggestion to convert to JPEG. The `unsupported_image` string is only shown for queued HEIC files, so naming the format explicitly does not affect other uploads; WebP and AVIF continue to use `noneditable_image`.

See related Gutenberg issue: WordPress/gutenberg#81123.

Follow-up to [48288].

Props khokansardar, annezazu.
Fixes #65800.


git-svn-id: https://develop.svn.wordpress.org/trunk@63013 602fd350-edb4-49c9-b593-d223f7449a82
…sing.

Disable the `big_image_size_threshold` filter alongside the existing client-side processing filters so the upload is stored untouched. The client's scaled sideload then keeps the plain `-scaled` name and records the untouched upload as `original_image`. Uploads that leave `generate_sub_sizes` enabled are unaffected.

Props khokansardar, ianmjones.
Fixes #65708.



git-svn-id: https://develop.svn.wordpress.org/trunk@63014 602fd350-edb4-49c9-b593-d223f7449a82
Ensure upload limits are honored when fetching sideloaded image from URL.

`WP_REST_Attachments_Controller::create_item_from_url()` only ran `check_upload_size()`, which returns early when `! is_multisite()`, so a single site had no ceiling at all on this path: `upload_max_filesize` and `post_max_size` bound a request body, not a fetch the server makes itself. Apply `wp_max_upload_size()` to the download, so a URL cannot bring in a file larger than the same site would accept as a direct upload, and pass that limit to the request as `limit_response_size` so an oversized file is not written to disk in full before being rejected. The multisite checks are unchanged and still run first, and no ceiling is applied when `wp_max_upload_size()` returns 0.

Follow-up to [62659], [62841].

Props andrewserong, courane01.
See #65517.



git-svn-id: https://develop.svn.wordpress.org/trunk@63015 602fd350-edb4-49c9-b593-d223f7449a82
Lance Willett and others added 30 commits September 3, 2026 14:35
The workflow installs Chromium before running the suite. Prevent `wp-scripts test-playwright` from installing Chromium, Firefox, and WebKit again when that setup has already run.

Also stop passing `--with-deps`, which only adds unused fonts on the current Ubuntu runner.

Developed in: #13369

Props adrianmoldovanwp, swissspidy, ugyensupport.
Fixes #66035.


git-svn-id: https://develop.svn.wordpress.org/trunk@63446 602fd350-edb4-49c9-b593-d223f7449a82
Upgrade tests previously stopped after checking the WordPress version on disk. Serve upgraded single-site installations with PHP's built-in server and verify the front end, REST API, database upgrade page, 404 handling, login, dashboard, and server log.

Disable cron and external HTTP requests during the check, and disable the runner's PHP JIT for the temporary server. Multisite remains excluded because moving a network to a temporary port requires coordinated configuration and database changes.

Developed in: #13355

Props adrianmoldovanwp.
See #66036.


git-svn-id: https://develop.svn.wordpress.org/trunk@63447 602fd350-edb4-49c9-b593-d223f7449a82
Update CSS for the login and registration screen for the tooltip icon on the Remember Me option so that the icon aligns correctly with the checkbox and input.

Props utsavladani, timse201, nkpathan, khokansardar, dhruvang21, pbiron, r1k0, ocean90, saiful09, joedolson.
Fixes #65918.

git-svn-id: https://develop.svn.wordpress.org/trunk@63448 602fd350-edb4-49c9-b593-d223f7449a82
Today there are 5 default themes that have `package.json` files:
- Twenty Nineteen
- Twenty Twenty
- Twenty Twenty-One
- Twenty Twenty-Two
- Twenty Twenty-Five

The `.nvmrc` file at the root of the repository will be used when modifying these themes in the context of a `wordpress-develop` checkout. But these themes exist outside of `wordpress-develop` more often than not. And there are times where the version of Node.js used by Core is not the same as one or more of the themes (this is currently the case with Twenty Nineteen).

This adds an `.nvmrc` file to each of the 5 themes that rely on Node.js. The theme testing GitHub Actions workflow is also updated to use each theme’s individual `.nvmrc` files to determine which version of Node.js to use instead of always defaulting to the version used for Core itself.

Fixes #66041.

git-svn-id: https://develop.svn.wordpress.org/trunk@63450 602fd350-edb4-49c9-b593-d223f7449a82
Introduce a `Maybe_Callable` PHPStan type alias for a callback that may or may not be defined in the current scope, and use it for the `$callback` parameters of `has_filter()`, `remove_filter()`, `has_action()`, `remove_action()`, `_wp_filter_build_unique_id()`, and the corresponding `WP_Hook` methods. This captures in one named type what these functions have always accepted, which is deliberately wider than `callable`.

Document the collected hook arguments as `list<mixed>`, narrowed to `non-empty-list<mixed>` for `apply_filters_ref_array()` and `apply_filters_deprecated()`, both of which read index 0 unconditionally. The `do_action` variants stay `list<mixed>`, since nothing on that path reads index 0 and an empty array is a legitimate argument: `wp_schedule_event()` and `wp_schedule_single_event()` both default `$args` to an empty array, and every such event reaches `do_action_ref_array()` with one.

Add `@no-named-arguments` to `apply_filters()` and `do_action()` so that spreading an associative array into them is reported. As of PHP 8.1 that syntax passes named arguments, which collect into an associative `$args` and lose the positional mapping the callbacks expect; in PHP 7 the keys were simply ignored.

In `WP_Hook::has_filter()`, pass an integer priority to `_wp_filter_build_unique_id()` rather than `false`, matching its documented `int $priority` parameter. The value is unused when building the key, so this is behavior-neutral, and it retires the corresponding entry from the PHPStan baseline. In `WP_Hook::apply_filters()`, assign the result of `current()` to a local variable and bail from the loop in the impossible case that it returns `false`, before storing it. This keeps `$current_priority` honestly typed as a list of integers.

Developed in #12443.
Follow-up to r38571, r52300, r62733.

Props westonruter, johnbillion, sergeybiryukov, swissspidy.
See #64896, #65817.


git-svn-id: https://develop.svn.wordpress.org/trunk@63451 602fd350-edb4-49c9-b593-d223f7449a82
Update CSS for active plugin updates to account for the changes in list table structure in r62958, which did not account for how plugin updates display notices in mobile viewports. Remove doubled left border and stabilize layout.

Props khokansardar, sukhendu2002, arkaprabhachowdhury, joedolson.
Fixes #65956.

git-svn-id: https://develop.svn.wordpress.org/trunk@63452 602fd350-edb4-49c9-b593-d223f7449a82
…s_content()`.

This replaces a manual `foreach` loop with the `array_all()` function, which expresses the same intent — return `true` only if every attachment ID resolves to a post of type `attachment` — without the loop-and-early-return boilerplate.

WordPress core includes a polyfill for `array_all()` on PHP < 8.4 as of WordPress 6.8, so the change works on every supported PHP version without raising the minimum requirement.

Developed in #12609.

Follow-up to r62553.

Props Soean, mukesh27.
See #65818.

git-svn-id: https://develop.svn.wordpress.org/trunk@63453 602fd350-edb4-49c9-b593-d223f7449a82
The variadic signatures could not be documented without names for their arguments, so the `arguments` object is replaced with modern rest parameters across `wp.customize.Class`, `Events`, `Value`, `Values`, `Element` and `Messenger`. The `Array.prototype.slice` alias they relied on is no longer needed and is removed. Rest parameters are supported by >96% of users globally and all browser versions supported by WordPress.  

The argument these two files receive was named `exports`, while the docblock beside the line using it said `window.wp.customize`. It is now `wp`, and the arguments of both wrapping functions are documented.

Many of the types named nothing that resolves. Seven tags were typed `mixed`, which is not a JSDoc type; one still carried the `[type]` placeholder an IDE had left behind; and one each read `...`, an unqualified `Value`, and `string|jQuery collection`, which is two words rather than a type expression. Where the jQuery namespace appeared it was spelled in lower case, so it named the `$` function rather than a collection or an event. The value accepted by `Value#set()` was typed as an object, though a `Value` holds anything. In loader.js the one documented parameter had no braces at all.

The remaining docblocks are new, since most of these methods carried none. Among what they now record: `Class` returns a function rather than an object whenever the prototype defines an instance method, which is how `wp.customize()` and `wp.customize.control()` come to be callable, and `Value#link()` binds the receiver to follow the values it is given rather than the reverse.

QUnit tests cover the applicator form of the constructor, the forwarding of arguments through the event methods, and `unsync()` in both directions, resolving two long-standing todos in that file.

Developed as subset of #10743.
Follow-up to r48110, r48650.

Props westonruter, afercia, grapplerulrich, vishalkakadiya, shailu25.
See #39671, #40831, #64662, #66033.


git-svn-id: https://develop.svn.wordpress.org/trunk@63454 602fd350-edb4-49c9-b593-d223f7449a82
Many of the types named nothing that resolves. The four deferred getters referred to their callback typedefs without a namespace, the promise they return was spelled `jQuery.promise`, which is neither the capitalization the namespace is declared under nor the name of a type, and jQuery events were typed as plain objects.

Two blocks documented the wrong thing outright. `ThemesPanel` lent its prototype to a name misspelled without the second `e`, so its methods were attached to a namespace that exists nowhere else, and `getInitialHeaderImage()` carried the return of the method beside it, describing a set of cropper options where its own summary already said it returns a model.

Parameters the code treats as optional are marked as such.

Developed as subset of #10743.
Follow-up to r41799, r48650, r63454.

Props westonruter, afercia.
See #39671, #39930, #40831, #64662, #66033.


git-svn-id: https://develop.svn.wordpress.org/trunk@63455 602fd350-edb4-49c9-b593-d223f7449a82
Three blocks described something the code does not do.

1. `WidgetsPanel` lent its prototype to `WigetsPanel`, so its methods were attached to a name that appears nowhere else in core.
2. `WidgetControl.onChangeExpanded()` said its arguments were merged over `defaultActiveArguments`, while the handler that calls it merges over `defaultExpandedArguments`; the two carry separate defaults and separate queues, so the wrong one points a reader at the wrong callback.
3. The field toggle handler in the menu section annotated `this` as a jQuery object, when it is used with `each()` and a click binding, both of which set `this` to the raw element its body then wraps.

The `offset` parameters described what they accept by writing out the two literals it may hold, which does not convey that the sign selects a direction rather than an amount.

Developed as subset of #10743.
Follow-up to r48650, r63454, r63455.

Props westonruter, afercia.
See #39671, #40831, #64662, #66033.


git-svn-id: https://develop.svn.wordpress.org/trunk@63456 602fd350-edb4-49c9-b593-d223f7449a82
Missing tags and descriptions are added, and the types are corrected, whether they named nothing resolvable (`Promise` for `JQuery.Promise<*>`), said too little (`Array` for `string[]`), or were narrower than what the code passes.

Both classes in selective-refresh.js lent their prototypes to the wrong name: `Partial` named `wp.customize.SelectiveRefresh.Partial`, capitalized unlike the namespace it lives in, and `Placement` named `wp.customize.selectiveRefresh` itself, so its methods were attached to the module rather than to the class.

Developed as subset of #10743.
Follow-up to r48110, r48650, r63454, r63455, r63456.

Props westonruter, afercia, grapplerulrich, mukesh27.
See #39671, #40831, #64662, #66033.


git-svn-id: https://develop.svn.wordpress.org/trunk@63457 602fd350-edb4-49c9-b593-d223f7449a82
Neither file documented a single method: only the classes themselves carried a docblock. Every method across the two now says what it does, in the third person, along with the arguments of the function wrapping each file.

One behavior is changed: `ChoiceListView.render()` returned nothing, unlike the sibling views beside it, so it now returns `this` as the Backbone convention expects. Nothing reads the value, since the view is only ever constructed, never chained, and `render` is otherwise reached as a `listenTo` handler, whose return is discarded.

Developed as subset of #10743.
Follow-up to r63454, r63455, r63456, r63457.

Props westonruter, afercia, grapplerulrich.
See #39671, #64662, #66033.
Fixes #40831.


git-svn-id: https://develop.svn.wordpress.org/trunk@63458 602fd350-edb4-49c9-b593-d223f7449a82
…em_for_response()

The commit prevents an uncaught fatal error (`Attempt to assign property "content" on null`) in `WP_REST_Templates_Controller::prepare_item_for_response()` when it receives a `null` template.

Developed in: #13375

Props aaronrobertshaw, ramonopoly, westonruter.

Fixes #66032.



git-svn-id: https://develop.svn.wordpress.org/trunk@63459 602fd350-edb4-49c9-b593-d223f7449a82
What a baseline records has to follow from core and the committed dist configuration alone, which is why the `phpstan:baselines` script pins the configuration it analyzes rather than reading whatever local `phpstan.neon` override a developer keeps beside `phpstan.neon.dist`. Its analysis nevertheless ran in the cache directory every other PHPStan run uses, and what a run leaves there depends on how that run was scoped (e.g. analyzing the entire project versus a single file or directory).

What PHPStan stores for a file it has read is not settled by that file's contents: the extensions in `tests/phpstan` apply to the files an analysis is scoped to rather than to every file it reads, so a run over a subset stores readings a full run would not. Sharing a directory with those runs, a regeneration read them back and recorded entries a clean analysis does not report.

Give the analysis `.cache/baselines`, a directory only this script writes to and only ever from a full run, suffixed with the configuration whenever `--config` names one other than the default.

Developed in #13395.
Follow-up to r63019, r63420.

See #65817.


git-svn-id: https://develop.svn.wordpress.org/trunk@63460 602fd350-edb4-49c9-b593-d223f7449a82
The zero shortcut used a strict `0 === $bytes` comparison, so `'0'`, `'0.0'` and `0.0` fell through to the magnitude loop and returned `false` while the integer `0` returned `'0 B'`. Normalize `$bytes` to a float once, up front, and compare it against `0.0` from then on. This treats every numeric spelling of zero alike, and also removes the repeated per-iteration cast the loop was doing along with resolving a PHPStan error.

Moving the cast up requires the value to be numeric, so non-numeric input now returns `false` before it rather than relying on the loop to carry it out the bottom. The documented type for `$bytes` is changes from `int|string` to `int|float|numeric-string`. That drops the site health call site from the `argument.type` baseline, where at level 5 it is no longer a wholly incompatible argument.

Developed in #7248.
Follow-up to r37962, r63024.

Props narenin, marian1, westonruter, martinkrcho, vrajadas, hellofromtonya, mukesh27.
See #36635.
Fixes #61930.


git-svn-id: https://develop.svn.wordpress.org/trunk@63461 602fd350-edb4-49c9-b593-d223f7449a82
A visitor tagged `phpstan.parser.richParserNodeVisitor` runs in PHPStan's `RichParser`, and `PathRoutingParser` sends a file there only when it is one of the files being analyzed. A file merely read so that something it declares can be reflected goes to the simple parser instead, where the visitors never run. That routing is safe for PHPStan's own parsers, which agree about everything reflection exposes, but the `HashNotationVisitor` added in r63420 rewrites `@param`, `@return` and `@var` docblocks, which are exactly what reflection exposes. Analyzing a subset of the tree therefore reports against types the visitor would have replaced wherever one crosses a file boundary, and writes that reading into the shared cache for the next full run to restore.

Have the simple parser wrap the rich one, so every parse rewrites the same docblocks, the cleaning still happens on top of it, and the reflection cache is keyed on contents correctly again. This redefines PHPStan's own `currentPhpVersionSimpleParser` service, which is not a documented extension point; the definition records what to check should a future release rename it. Full runs report exactly what they did before, and every baseline still matches. A run over a subset now does the parsing it previously skipped, so a cold cache pays a few percent for it, while a warm one is unchanged.

Developed in #13396.
Follow-up to r63420, r63460.

Props westonruter, swissspidy.
See #65817.


git-svn-id: https://develop.svn.wordpress.org/trunk@63462 602fd350-edb4-49c9-b593-d223f7449a82
Removes the PHP opening tag and manual WordPress bootstrap now that WordPress Playground and the Code Reference load WordPress before running interactive examples. Prints each class name directly and places the expected output in a trailing comment.

Developed in #13267.

Follow-up to r63293.

Props jonsurrell, dmsnell.
See #65860.


git-svn-id: https://develop.svn.wordpress.org/trunk@63463 602fd350-edb4-49c9-b593-d223f7449a82
…flow.

This changeset adds a `lint:jsdoc` Grunt task and includes it in the `precommit:js` task list.

The existing `lint:jsdoc` NPM script was restored to a working configuration in #65939. It broke with the upgrade of ESLint to version 10 in the `@wordpress/scripts` package in the Gutenberg repository. See WordPress/gutenberg#76654.

By including `lint:jsdoc` into CI, future potential breakages will be detected soon. Also, this change aims to reinforce the long-term goal of improving the JavaScript inline documentation that was started years ago in the ​WordPress JavaScript Docs Coding Standards initiative. See https://make.wordpress.org/core/handbook/docs/inline/js/.
Future improvements will be part of ongoing maintenance work. See for example #66033.

Developed in #13336

Props afercia, westonruter.
See #65939, #65950, #66033.


git-svn-id: https://develop.svn.wordpress.org/trunk@63464 602fd350-edb4-49c9-b593-d223f7449a82
The affected branches will regenerate and commit their CSS output instead of skipping the CSS precommit task. This preserves the check for future CSS drift.

Reverts r63445.

Props desrosj, khokansardar.
See #65993.


git-svn-id: https://develop.svn.wordpress.org/trunk@63465 602fd350-edb4-49c9-b593-d223f7449a82
All four font-face test classes use the same theme fixtures. Prepare them in the shared base class and remove redundant child-class setup.

Follow-up to [63435].

Developed in: #13392

Props jonsurrell, mukesh27.
See #65893.


git-svn-id: https://develop.svn.wordpress.org/trunk@63466 602fd350-edb4-49c9-b593-d223f7449a82
Clean up `wp_e2e_*` tables before and after the installation test so stale database state cannot affect later runs. Fail when cleanup or the table-prefix rewrite does not complete safely.

Retry the initial navigation while waiting for the installation route after rewriting `wp-config.php`.

Developed in: #13302

Props theanamhossain, lucatume, adrianmoldovanwp.
Fixes #65982.


git-svn-id: https://develop.svn.wordpress.org/trunk@63467 602fd350-edb4-49c9-b593-d223f7449a82
The `wp_render_block_states_support()` function is hooked on `render_block`, so it runs once per block on every front-end request. Before it could determine that a block has no state styles, it resolved the block type from the registry, called `wp_get_global_settings()`, and computed responsive media queries; all of this work is discarded for the overwhelming majority of blocks, which carry no `style` attribute at all.

Every CSS rule the function can produce is keyed off the block's `style` attribute, and the function already returns the content unchanged when no rules are generated. Resolving `style` first and returning early when it is absent is therefore behavior-preserving.

Developed in #13051 and WordPress/gutenberg#81908.
Follow-up to r62453, r62671.

Props mukesh27, westonruter, adamsilverstein, wildworks.
Fixes #65929.


git-svn-id: https://develop.svn.wordpress.org/trunk@63474 602fd350-edb4-49c9-b593-d223f7449a82
… scripts.

The reusable workflow responsible for testing the Gutenberg build script when cloned into the `src/wp-content/plugins` directory configures Node.js based on the `.nvmrc` file in this repository. However, this causes failures when that version is no longer compatible with the latest changes in the `trunk` branch of `gutenberg`.

The workflow is no longer used by new branches, but it’s still called by some old ones that use Node.js 20.x. When Gutenberg is updated to use 24.x in the coming days, the workflow runs for these old branches will fail because of this.

Additionally, the Gutenberg plugin has not suported these older versions of WordPress still running the workflow for some time. It only makes sense to test building `gutenberg` code that supports the version of WordPress running the tests.

This introduces a `gutenberg-branch` input so that the corresponding `wp/X.Y` branch from `gutenberg` can be pinned after a new version of WordPress is branched.

Props desrosj, lancewillett, lucatume.
Fixes #66040.

git-svn-id: https://develop.svn.wordpress.org/trunk@63475 602fd350-edb4-49c9-b593-d223f7449a82
PHP 8.6 has entered the beta/RC phase of it’s release cycle and is due out at the end of 2026.

To help contributors prepare, the PHPUnit strategy matrix now includes this version. Since the test suite does not pass with PHP 8.6 yet, these new jobs are allowed to fail until the potential compatibility issues can be addressed.

Props desrosj, lancewillett, jorbin.
Fixes #65904.

git-svn-id: https://develop.svn.wordpress.org/trunk@63480 602fd350-edb4-49c9-b593-d223f7449a82
Continuing the migration away from manually constructed `SCRIPT` markup, a subset of the admin's raw inline scripts now print through `wp_print_inline_script_tag()`: those in `wp-admin/admin-header.php`, those in `wp-admin/includes/media.php`, and those in `iframe_header()`/`iframe_footer()` in `wp-admin/includes/template.php`. For those screens this is what r56687 did for the frontend and the login screen, making `wp_inline_script_attributes` the single point at which a per-request nonce can be attached. This is one step toward an admin Content Security Policy opt-in rather than the whole of it.

The data these scripts carry is now serialized with `wp_json_encode()` using `JSON_HEX_TAG | JSON_UNESCAPED_SLASHES` instead of being assembled from `esc_js()` string fragments. This corrects the values that reach JavaScript: `esc_js()` passes the text through `_wp_specialchars()`, so `ajaxurl`, `pagenow`, `typenow`, `adminpage`, `thousandsSeparator`, and `decimalPoint` previously arrived carrying HTML entities in place of the literal characters (e.g. a `thousands_sep` of `&` was delivered as `&amp;`).

Inlined JS is also unminified and reformatted, with improvements to strict-mode compatibility. Static blocks use nowdoc heredocs so that editors syntax-check the JavaScript.

Developed in #13319.
Follow-up to r56687, r60681, r60909, r60913.

Props thanhtinpk, westonruter.
See #59444, #59446, #63851.


git-svn-id: https://develop.svn.wordpress.org/trunk@63481 602fd350-edb4-49c9-b593-d223f7449a82
Update CSS for paused plugins in recovery mode to account for the changes in list table structure in r62958, which did not account for this case on small viewports.

Props r1k0, joedolson.
Fixes #65985.

git-svn-id: https://develop.svn.wordpress.org/trunk@63482 602fd350-edb4-49c9-b593-d223f7449a82
…ate autosaves controller.

The `WP_REST_Template_Autosaves_Controller` class redeclared a private `$parent_post_type` property and assigned it in its constructor. Both were dead code. The parent class `WP_REST_Autosaves_Controller` already declares and sets this property, and because it is declared `private`, the child class's copy could never be accessed by the parent's methods, nor was it ever read anywhere within the child class itself. The result was confusing property shadowing without any functional purpose.

This change removes the duplicate property declaration and the corresponding assignment in the constructor. Since the property was never read in the child class and was effectively a separate, unused storage slot, there is no change in runtime behavior.

Developed in #12295.

Follow-up to r56819.

Props Soean.
See #65818.

git-svn-id: https://develop.svn.wordpress.org/trunk@63485 602fd350-edb4-49c9-b593-d223f7449a82
…ten`.

The sole `property.onlyWritten` error identified by PHPStan was [#12295 fixed] without the baselines being regenerated.

Follow-up to r63485.

See #65817, #65818.


git-svn-id: https://develop.svn.wordpress.org/trunk@63486 602fd350-edb4-49c9-b593-d223f7449a82
* Restore `void` to the `@return` unions of `wpdb::print_error()` and `wpdb::check_database_version()`, which r62177 replaced with `null`.
* Add the `null` that fifteen tags describe in prose but omit from a `@return` listing only `string|void`.
* Match every falsy spelling of a display flag, and every argument shape reaching a bail, so those calls resolve to `void`; a query string still cannot be read, tracked in #66049.
* Narrow the deprecated param for `trackback_url()` so that static analysis catches the obsolete usage.

Developed in #13371.
Follow-up to r32568, r61766, r61768, r62177, r62178, r63440, r63441.

Props marian1, westonruter.
See #64703, #64704, #65817, #66049.


git-svn-id: https://develop.svn.wordpress.org/trunk@63487 602fd350-edb4-49c9-b593-d223f7449a82
Requesting a count passed the numeric string `get_terms()` returns straight to `array_merge()`, which warns and yields null on PHP 7.4 and throws a `TypeError` on PHP 8.0 and later. The count is now cast before it is merged, and summed once every taxonomy has been queried, so the function returns the numeric string its documentation has described since r49947. An empty object or taxonomy list returns `'0'` for the same reason, rather than the empty array that contradicted the documented type.

A taxonomy registered with an `args` array is queried by a separate recursive call, and those results were merged with `array_merge()` unconditionally. For the `id=>` values of `fields` the term IDs are integer array keys, which `array_merge()` renumbers, so such a taxonomy came back keyed from zero. The recursive branch now uses the union operator for those, as the merge for the remaining taxonomies has done since r41809.

The functions `get_terms()`, `wp_get_object_terms()`, `wp_count_terms()`, `wp_get_post_categories()`, `wp_get_post_tags()` and `wp_get_post_terms()` each gain a conditional return type that resolves the result from the `fields` value, falling back to what that function's own default answers with, as was done for `WP_Term_Query::query()` in r63358.

Developed in #7278.
Follow-up to r38667, r40513, r41809, r49947, r63358.

Props marian1, westonruter, swissspidy.
See #65817, #66049.
Fixes #61936.


git-svn-id: https://develop.svn.wordpress.org/trunk@63488 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.