39886 Commits

Author SHA1 Message Date
wildworks e01a0f987a KSES: Allow SVG presentation attributes in safe_style_css.
Add SVG presentation attributes to the list of CSS properties allowed by `safecss_filter_attr()`, so inline SVG markup can be styled via the `style` attribute.

This ports Gutenberg PR #79172 to Core.

Props afercia, westonruter, wildworks.
Fixes #65457.

Built from https://develop.svn.wordpress.org/trunk@62530


git-svn-id: http://core.svn.wordpress.org/trunk@61811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-19 06:42:44 +00:00
Weston Ruter 647e60c688 Docs: Clarify return value semantics of wpdb query methods.
This eliminates over 400 PHPStan errors from the core codebase.

* Clarify the inline documentation for the four `wpdb` query methods — `get_results()`, `get_row()`, `get_col()`, and `get_var()`.
* Add `@phpstan-return` conditional types that mirror each method's runtime dispatch on `$query` and `$output`.
* Add `@phpstan-param` tags narrowing `$output` to the documented constants.
* Document that `get_var()` returns `null` both on failure and when the matched cell value is an empty string, directing consumers to `$this->last_error` to distinguish the two cases.
* Tighten the `@return` in `get_results()` from `array|object|null` to `array|null`, since the method never returns a bare `stdClass`; the `object` was a copy/paste artifact from `get_row()`.
* Fix a deprecated use of `null` as an array offset (PHP 8.5) in the `OBJECT_K` branch when a row's first column is SQL `NULL`.
* Gather `get_col()` data as a true list.
* Suggest `ext-mysqli` in `composer.json`, which `wpdb` requires at runtime.

Developed in https://github.com/WordPress/wordpress-develop/pull/11855.

Props apermo, westonruter.
See #30257, #64898.
Fixes #65261.

Built from https://develop.svn.wordpress.org/trunk@62529


git-svn-id: http://core.svn.wordpress.org/trunk@61810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-18 23:24:39 +00:00
Sergey Biryukov c880d6b49f Docs: Correct variable reference in wpdb::delete() DocBlock.
Follow-up to [47740].

Props nareshbheda, manishxdp.
Fixes #65470.
Built from https://develop.svn.wordpress.org/trunk@62527


git-svn-id: http://core.svn.wordpress.org/trunk@61808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-18 22:20:42 +00:00
Aaron Jorbin f0912cbf0c Editor: Allow publish meta box action row to wrap.
Instead of crowding the row, actions added by extenders should wrap to new lines. This change has been tested in both the classic editor plugin and hotfix plugin.

Follow-up to [61645].

Props abhishekfdd, masteradhoc, rlucian, sabernhardt, cogdesign, threadi, darshitrajyaguru97, desrosj, davidbaumwald, jorbin.
Fixes #65286.

Built from https://develop.svn.wordpress.org/trunk@62526


git-svn-id: http://core.svn.wordpress.org/trunk@61807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-18 21:21:38 +00:00
desrosj a141751b83 Build/Test Tools: Ensure all built files are deleted as expected.
Block editor-related files can currently become stale or are not always deleted from `src` through the relevant `grunt clean` commands reliably. In the past, this primarily caused issues locally when a CSS file was copied from the `@wordpress/block-library` npm package into `src` and later removed from the package entirely. The result was a failing `grunt verify:old-files` task until the `grunt clean` command was run with the `--dev` flag.

After [61438] this issue presented in new ways. Mainly, files would remain in the core.svn.wordpress.org build repository indefinitely unless explicitly deleted. [62051] brought the `grunt clean` tasks up to date, but there are still paths where files remain unexpectedly or have outdated contents after rebuilding. This can cause incomplete or inaccurate commits where built files subject to version control are not updated correctly, especially when changing the `gutenberg.sha` value in `package.json`.

This change improves the build script to ensure that all files sourced from the zip file with assets built by the Gutenberg repository are always fresh and up to date, and any files that are deleted from the built zip file are also deleted from version control appropriately (in both the `develop` and `core` repositories).

A handful of changes were required to accomplish this:
- All Gutenberg-sourced outputs are written to `src/` regardless of `--dev`. In production builds, `build:gutenberg` runs before `build:files`, and `copy:files` propagates the tree to `build/`.
- `gutenbergFiles` has been split into two different arrays: `gutenbergUnversionedFiles` and `gutenbergVersionedFiles`. The `src` argument for the `clean:gutenberg` task is dynamically populated at run time with a bare `grunt clean` cleaning only the unversioned subset (so version-controlled files are not unexpectedly deleted), and explicit `clean:gutenberg` (or any chain through `build:gutenberg`) cleans both, removing files deleted upstream from version control.
- `clean:gutenberg` no longer wipes non-Gutenberg sourced files from `wp-includes/js/`. All file/path lists have been updated to only match files the related tasks are directly responsible for managing.
- `tools/gutenberg/copy.js` has been added to `tsconfig.json` and brought under `tsc --build` strict-mode checking. The large `copyBlockAssets()` function was broken into one named function per asset type, each typed against the relevant `COPY_CONFIG` slice. The split is a code-clarity improvement, not a bug fix.

Props desrosj, westonruter, jorbin, adamsilverstein.
Fixes #65452.
Built from https://develop.svn.wordpress.org/trunk@62525


git-svn-id: http://core.svn.wordpress.org/trunk@61806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-18 21:09:44 +00:00
dmsnell ea9e2e1112 Performance: avoid over-allocation in wp_is_numeric_array()
When a trace of allocations revealed that `wp_is_numeric_array()`
accounted for a significant fraction of the allocations in a page
render, it was observed that the function eagerly allocates and copies
array keys and then filters them when all it wants to know is whether a
single key in the array meets a condition.

In this patch the `array_filter( array_keys() )` invocation is replaced
with early-aborting iteration to avoid the memory allocation and
copying.

This patch was prepared as part of WCEU 2026 Contributor Day.

Developed in: https://github.com/WordPress/wordpress-develop/pull/12100
Discussed in: https://core.trac.wordpress.org/ticket/65467

Follow-up to [34927].

Props dmsnell, westonruter, yusufmudagal.
Fixes #65467.

Built from https://develop.svn.wordpress.org/trunk@62524


git-svn-id: http://core.svn.wordpress.org/trunk@61805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-18 17:50:43 +00:00
jonsurrell b6e1fd6b2a Charset: Limit _wp_scan_utf8() ASCII scan to remaining code points.
The ASCII fast-path in `_wp_scan_utf8()` uses `strspn()` to skip past ASCII bytes. When a code point limit was provided without a byte limit, the scan would include the rest of the input even when there was a code point limit. Because ASCII characters are single-byte code points, the fast-path scan length can be bounded by the number of remaining code points. This improves performance when working with some large documents.

Developed in https://github.com/WordPress/wordpress-develop/pull/12214.

Follow-up to [60768].

Props jonsurrell, dmsnell, zieladam.
Fixes #65483. See #63863.

Built from https://develop.svn.wordpress.org/trunk@62523


git-svn-id: http://core.svn.wordpress.org/trunk@61804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-18 16:46:43 +00:00
cbravobernal b151a33cda Block Bindings: Preserve nested inner blocks when binding rich text.
`WP_Block::replace_html()` replaced the entire element matched by a rich-text attribute's selector, dropping any markup produced by inner blocks rendered inside that element (e.g. a List nested inside a List Item).

Props cbravobernal, jonsurrell.
Fixes #65406.

Built from https://develop.svn.wordpress.org/trunk@62522


git-svn-id: http://core.svn.wordpress.org/trunk@61803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-18 10:37:43 +00:00
Weston Ruter 4eaa1df44a Embeds: Replace the blue site icon fallback with the gray WordPress logo.
Adds gray WordPress logo image files (`w-logo-gray-white-bg.png` and `w-logo-gray-white-bg.svg`) to `wp-includes/images/`, and updates `the_embed_site_title()` and `do_favicon()` to use the new images as the fallback site icon, maintaining visual consistency with the login screen logo updated in r61989.

Replaces CSS custom property references for focus styles in the embed template (`--wp-admin-theme-color` and `--wp-admin-border-width-focus`) with their literal values, as these admin-theme variables are not defined in the oEmbed template context.

Developed in https://github.com/WordPress/wordpress-develop/pull/11293.
Follow-up to r61652, r61989, r62502.

Props sabernhardt, huzaifaalmesbah, westonruter, jamesbregenzer.
See #64708.
Fixes #64877.

Built from https://develop.svn.wordpress.org/trunk@62521


git-svn-id: http://core.svn.wordpress.org/trunk@61802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-18 02:05:44 +00:00
Weston Ruter e45892b023 Editor: Fix wp-elements-* CSS class name collisions for identical blocks.
The `wp_get_elements_class_name()` function previously generated CSS class names by hashing the serialized block data via `md5()`. Identical blocks received the same `wp-elements-*` class name and the Style Engine deduplicated their CSS rules into one, causing a parent block's element style (e.g. link color) to cascade down and override a child block's identical style due to CSS source order.

The function is updated to use `wp_unique_prefixed_id()` instead, generating sequential unique class names (`wp-elements-1`, `wp-elements-2`, etc.) that match the block editor's JavaScript implementation. The now-unused `$parsed_block` parameter is removed from the function signature.

PHPStan rule level 10 errors are also resolved in the related code. See #64898.

Developed in https://github.com/WordPress/wordpress-develop/pull/12126.
Follow-up to r53260, r58074.

Props tusharbharti, westonruter, wildworks.
Fixes #65435.

Built from https://develop.svn.wordpress.org/trunk@62520


git-svn-id: http://core.svn.wordpress.org/trunk@61801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-18 00:10:45 +00:00
jonsurrell 73f8bbb1d8 HTML API: Improve comment about HTML syntax characters.
Developed in https://github.com/WordPress/wordpress-develop/pull/12207.

Follow-up to [62507].

Props dmsnell.
See #64896.

Built from https://develop.svn.wordpress.org/trunk@62519


git-svn-id: http://core.svn.wordpress.org/trunk@61800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-17 14:56:40 +00:00
cbravobernal 8f2ba3fd6b Block Bindings: Add List Item Block Support.
Add `core/list-item` to the block attributes supported by block bindings so its `content` rich text can be bound, and cover the basic (non-nested) case in the render tests.

This is a clean enablement with no render-side changes. A List Item that contains a nested List keeps both inside the same `<li>`; preserving that nested list when `content` is bound is handled separately by the `WP_Block::replace_html()` inner-block fix.

Props sauliusv, cbravobernal.
See #65406.


Built from https://develop.svn.wordpress.org/trunk@62518


git-svn-id: http://core.svn.wordpress.org/trunk@61799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-17 14:50:39 +00:00
Sergey Biryukov 94211f8455 Media: Make ::update_size() parameters consistent across image editors.
Includes:
* Standardizing default values on `null` vs. `false`.
* Updating the documentation to correct parameter types.
* Adding missing parameter descriptions.

Follow-up to [22094].

Props Soean, mukesh27, SergeyBiryukov.
See #64897.
Built from https://develop.svn.wordpress.org/trunk@62517


git-svn-id: http://core.svn.wordpress.org/trunk@61798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-17 11:35:41 +00:00
wildworks 7755215ff9 Admin Reskin: Fix interactive control heights on mobile.
Give interactive elements a consistent 40px height in the admin mobile viewport on the Add Plugins, Media Library grid, Settings > General, and Add Themes screens.

Follow-up to [61645].

Props abcd95, wildworks.
Fixes #64999.

Built from https://develop.svn.wordpress.org/trunk@62516


git-svn-id: http://core.svn.wordpress.org/trunk@61797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-17 10:57:42 +00:00
wildworks a5d075a061 Icons: Enforce strict name validation in the register method.
Reject icon names that use uppercase letters, that lack a namespace prefix, or that have already been registered. Add tests covering these cases.

Props im3dabasia1, mukesh27, wildworks.
See #64847.

Built from https://develop.svn.wordpress.org/trunk@62515


git-svn-id: http://core.svn.wordpress.org/trunk@61796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-17 10:35:45 +00:00
isabel_brison 2ad610c9cf Editor: fix responsive element styles front end output.
Outputs viewport-specific state styles for elements such as Link or Heading that are part of a block.

Props isabel_brison, ramonopoly.
Fixes #65164.

Built from https://develop.svn.wordpress.org/trunk@62514


git-svn-id: http://core.svn.wordpress.org/trunk@61795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-17 03:38:45 +00:00
isabel_brison f5899c925c Editor: add support for aspect ratio and related controls in viewport states.
Enables responsive aspect ratio, scale, width, height and min-height in Image, Featured image and Cover blocks.

Props isabel_brison, ramonopoly.
See #65164.

Built from https://develop.svn.wordpress.org/trunk@62513


git-svn-id: http://core.svn.wordpress.org/trunk@61794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-17 01:18:39 +00:00
Peter Wilson 99cc9dd09b Help/About: Restore image cache busting strings to 7.0.
Reverts the update to cache busting strings in r62423 to restore them to `ver=7.0`. As the images will not change in WordPress 7.0.1 there is no need to deal with stale caches.

Follow-up to r62423.

Props peterwilsoncc, mukesh27, wildworks.
See #65352.


Built from https://develop.svn.wordpress.org/trunk@62512


git-svn-id: http://core.svn.wordpress.org/trunk@61793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-17 01:17:45 +00:00
Weston Ruter f8b16850e8 Comments: Remove touchstart event listeners from comment reply/cancel links.
The `touchstart` event on comment reply and cancel links fired before the browser could distinguish a tap from a scroll gesture, causing the reply form to open unexpectedly during scrolling. Since touchscreen users tapping a link already generate a `click` event, the `touchstart` listeners are unnecessary. Prior to ~2015 a `touchstart` event may have been useful to eliminate a 300ms delay for event handlers on tap, but this is long obsolete.

Developed in https://github.com/WordPress/wordpress-develop/pull/12168.
Follow-up to r42360.

Props edent, szandman, SergeyBiryukov, westonruter, afercia, peterwilsoncc, janpaulkleijn, madhazelnut, joostdevalk, pbearne, eherman24, Znuff.
See #47510, #31590.
Fixes #46713.

Built from https://develop.svn.wordpress.org/trunk@62511


git-svn-id: http://core.svn.wordpress.org/trunk@61792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-16 20:21:45 +00:00
desrosj a4bafe3779 Twenty Nineteen: Ensure only one PostCSS module is configured.
The `postcss.config.js` file in Twenty Ninteen currently has two `module.exports` asignments configuring two plugins: `autoprefixer` (for ensuring browser-specific CSS nuances are accounted for) and `postcss-focus-within` (ensures `:fucs-within` rules are duplicated as `[focus-within]` attribute selectors).

The first assignment is being ignored entirely, which means `autoprefixer` never runs against generated CSS files.

This updates the `postcss.config.js` file to contain only one `modules.export` statement, which restores the behavior of `autoprefixer`. The dependencies related to browser usage statistics have also been updated, and the resulting changes to built CSS files subject to version control are also included:
- Browser-specific prefixes for the `hyphens` property have been removed.
- The `::-moz-selection` is no longer required for the `::selection` psuedo-element.
- Brower-specific prefixes are no longer required for `min-content` and `max-content` values.
- Webkit browsers no longer require a `-webkit-` prefix for `user-select: none`.
- The `-webkit-` prefix is no longer required for the `filter` property.
- The `text-decoration` property no longer requires browser prefixes.

Fixes #65452.
Built from https://develop.svn.wordpress.org/trunk@62510


git-svn-id: http://core.svn.wordpress.org/trunk@61791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-16 18:21:45 +00:00
jonsurrell 377437d2ee HTML API: Ensure tag processor recognizes SCRIPT tag closers.
Address edge cases where SCRIPT tag closers were not detected and the processor remained paused on an incomplete token.

Developed in https://github.com/WordPress/wordpress-develop/pull/12184.

Props jonsurrell, dmsnell.
See #65372.

Built from https://develop.svn.wordpress.org/trunk@62509


git-svn-id: http://core.svn.wordpress.org/trunk@61790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-16 17:14:45 +00:00
desrosj 1fe530a211 Build/Test Tools: Output a list of discovered routes.
The list of routes to be copied by the `copy:routes` Grunt task is configured dynamically by the `routes:setup` task, which parses the `gutenberg/build/routes/registry.php` file included in the built asset from the `gutenberg` repository.

The task currently produces ouitput only when an error is encountered, such as a missing `registry.php` file or invalide route name.

This adjusts the task to produce output so that the list of routes being processed is clear.

See #65471.
Built from https://develop.svn.wordpress.org/trunk@62508


git-svn-id: http://core.svn.wordpress.org/trunk@61789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-16 16:04:44 +00:00
jonsurrell 2fd5c4f655 HTML API: Correct and improve documentation issues.
Developed in https://github.com/WordPress/wordpress-develop/pull/12043.

Props jonsurrell, westonruter, dmsnell.
See #64896.

Built from https://develop.svn.wordpress.org/trunk@62507


git-svn-id: http://core.svn.wordpress.org/trunk@61788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-16 09:49:45 +00:00
isabel_brison 5bdde8ef97 Editor: fix background color and image incompatibility in state styles.
Unsets any existing background-image if background color is applied as a viewport state.

Props iamchitti, isabel_brison.
Fixes #65239.

Built from https://develop.svn.wordpress.org/trunk@62506


git-svn-id: http://core.svn.wordpress.org/trunk@61787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-16 07:02:40 +00:00
isabel_brison 351d77ea91 Editor: fix flex child fixed width and introduce max width option.
Ensures "fixed" becomes actually fixed with `flex-shrink: 0`, and introduces a new "max" designation for the current behaviour of "fixed".

Props isabel_brison, andrewserong.
Fixes #65462.

Built from https://develop.svn.wordpress.org/trunk@62505


git-svn-id: http://core.svn.wordpress.org/trunk@61786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-16 06:50:44 +00:00
isabel_brison 36be44e376 Editor: ensure layout classnames are applied to the inner blocks wrapper.
Checks that the element classnames get added to doesn’t have a closing tag before the inner blocks start.

Props isabel_brison, andrewserong, @darshitrajyaguru97, @tusharaddweb, @gaurangsondagar.
Fixes #65101.

Built from https://develop.svn.wordpress.org/trunk@62504


git-svn-id: http://core.svn.wordpress.org/trunk@61785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-16 04:31:39 +00:00
Sergey Biryukov 1d98b0f3e3 Coding Standards: Remove redundant arguments of add_filter().
The arguments match the parameters' default values.

Follow-up to [61019].

Props Soean.
See #64897.
Built from https://develop.svn.wordpress.org/trunk@62503


git-svn-id: http://core.svn.wordpress.org/trunk@61784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-15 23:22:42 +00:00
Weston Ruter e80b13ea6d Embeds: Preserve the site icon fallback URL.
Previously, `get_site_icon_url()` overwrote a caller-supplied fallback URL with the return value of `wp_get_attachment_image_url()` even when that lookup returned `false`, so a defined fallback (such as the bundled WordPress logo) was silently discarded whenever the assigned site icon attachment could not be resolved. Only update the URL when a non-empty attachment URL is returned.

Additionally, `the_embed_site_title()` now renders the site icon `<img>` only when a URL is available, and omits the `srcset` attribute when the 2x URL is missing or identical to the 1x URL. This avoids the malformed markup (an empty `src` and a bare ` 2x` `srcset`) that produced a broken image and spurious requests in oEmbed cards.

Developed in https://github.com/WordPress/wordpress-develop/pull/11601.
Follow-up to r35571, r36693, r47832.

Props sukhendu2002, sabernhardt, mukesh27, westonruter, pontocinza, mohamedahamed, abcd95, manhar, rollybueno.
Fixes #65098.

Built from https://develop.svn.wordpress.org/trunk@62502


git-svn-id: http://core.svn.wordpress.org/trunk@61783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-15 20:48:43 +00:00
Weston Ruter 152489926e Embeds: Validate registered oEmbed providers.
A plugin may register an oEmbed provider through the `oembed_providers` filter using a malformed structure, such as an associative array rather than the expected tuple of a provider endpoint URL string at index 0 and an optional boolean regex flag at index 1. This previously produced `Undefined array key` PHP warnings when `WP_oEmbed::get_provider()` destructured the entry.

Introduce a private `sanitize_provider()` method that validates the match pattern and provider data, normalizing the optional regex flag to a boolean. The constructor now skips malformed entries and reports each one via `_doing_it_wrong()`, and `get_provider()` likewise ignores any invalid entries it encounters at runtime.

Developed in https://github.com/WordPress/wordpress-develop/pull/11568.

Props sukhendu2002, westonruter, bradshawtm, rollybueno.
Fixes #65068.

Built from https://develop.svn.wordpress.org/trunk@62501


git-svn-id: http://core.svn.wordpress.org/trunk@61782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-15 20:14:45 +00:00
Aaron Jorbin ae65b65f29 Build/Test: Fix documentation that describes each step in coding standard and phpstan workflows.
Props khokansardar, jorbin.
See #64894. Fixes #65391.

Built from https://develop.svn.wordpress.org/trunk@62500


git-svn-id: http://core.svn.wordpress.org/trunk@61781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-15 19:48:42 +00:00
Sergey Biryukov d3aa66f680 Coding Standards: Remove unused local variable $all_class_directives.
This removes an unused variable in `WP_Interactivity_API::data_wp_class_processor()`.

Follow-up to [57563], [61020].

Props Soean.
See #64897.
Built from https://develop.svn.wordpress.org/trunk@62499


git-svn-id: http://core.svn.wordpress.org/trunk@61780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-14 23:46:44 +00:00
Sergey Biryukov 144238508b Coding Standards: Correct casing of chr() and ord() in class-pclzip.php.
This replaces `Chr()` and `Ord()` with their canonical lowercase forms `chr()` and `ord()`.

This is flagged as a case-sensitivity violation by the upcoming [https://wiki.php.net/rfc/case_sensitive_php PHP 8.6 RFC], which will emit `E_DEPRECATED` for function references that don't match their declared casing. Fixing it now keeps WordPress ahead of the deprecation.

Props Soean.
See #64897.
Built from https://develop.svn.wordpress.org/trunk@62498


git-svn-id: http://core.svn.wordpress.org/trunk@61779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-13 23:08:30 +00:00
Sergey Biryukov b5e5baad7b Docs: Correct the DocBlock for build_query().
This updates the `@param` and `@return` descriptions to state that `build_query()` does **not** URL-encode, unlike PHP's native `http_build_query()`, and that callers are responsible for encoding the values beforehand or late-escaping the output with `esc_url()`.

Follow-up to [8215].

Props nimeshatxecurify,  johnbillion.
Fixes #65453.
Built from https://develop.svn.wordpress.org/trunk@62497


git-svn-id: http://core.svn.wordpress.org/trunk@61778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-12 23:43:45 +00:00
desrosj 0d137dfa43 Build/Test Tools: Update codecov/codecov-action to 7.0.0.
This updates `codecov/codecov-action` from `v5.5.3` to `v7.0.0`, which includes a change in Keybase account being used by the action to one that Codecov is able to update going forward. Coverage reports are currently failing because of an inability to verify GPG signature integrity.

See #64893.
Built from https://develop.svn.wordpress.org/trunk@62496


git-svn-id: http://core.svn.wordpress.org/trunk@61777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-12 02:02:38 +00:00
Weston Ruter 7f47bb379c Build/Test Tools: Upgrade PHPStan to version 2.2.2.
Developed in https://github.com/WordPress/wordpress-develop/pull/12158.

See #64898.

Built from https://develop.svn.wordpress.org/trunk@62495


git-svn-id: http://core.svn.wordpress.org/trunk@61776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-12 01:51:40 +00:00
Weston Ruter 30ee5ef58e Media: Consistently escape URLs in attachment download links and JS data.
The "Download file" link in `attachment_submitbox_metadata()` escaped its `href` with `esc_attr()`, which only HTML-encodes the value. Use `esc_url()` instead, the correct function for a URL in an `href` attribute, since `$att_url` comes from `wp_get_attachment_url()`. This applies the same escaping method for the Download link in the media list table output by `WP_Media_List_Table::_get_row_actions()`.

Apply the same correction to `wp_prepare_attachment_for_js()`, wrapping the attachment, intermediate size, full-size, original image, and image source URLs in `esc_url_raw()` so the Backbone-rendered media UI emits URLs filtered through `clean_url` just like the server-rendered templates.

Developed in https://github.com/WordPress/wordpress-develop/pull/12062.
Follow-up to r21680, r47202, r55156, r55198, r55221.

Props thisismyurl, westonruter, sabernhardt, gazipress, jamesbregenzer, manhar, sanayasir, freewebmentor.
See #57574, #41474.
Fixes #65397.

Built from https://develop.svn.wordpress.org/trunk@62494


git-svn-id: http://core.svn.wordpress.org/trunk@61775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-12 01:45:43 +00:00
Sergey Biryukov a27f0e9628 Docs: Correct @since tags in WP_Theme_JSON for responsive block nodes.
Follow-up to [62444].

Props khokansardar, huzaifaalmesbah, isabel_brison, sabernhardt, manhar, SergeyBiryukov.
Fixes #65390.
Built from https://develop.svn.wordpress.org/trunk@62493


git-svn-id: http://core.svn.wordpress.org/trunk@61774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-11 23:10:41 +00:00
dmsnell f943849436 HTML API: preserve adjusted foreign attributes on serialization.
Discovered during fuzz-testing of the HTML API. Adjusted foreign attributes, such as `xlink:href`, were being normalized with a space instead of a colon through `::serialize_token()`. This led to the creation of two attributes on output instead of the proper singular attribute.

This patch corrects the issue by ensuring that the attribute namespace and name are separated by a colon when serializing.

Developed in: https://github.com/WordPress/wordpress-develop/pull/12140
Discussed in: https://core.trac.wordpress.org/ticket/65372

Props jonsurrell.
See #65372.

Built from https://develop.svn.wordpress.org/trunk@62492


git-svn-id: http://core.svn.wordpress.org/trunk@61773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-11 22:18:43 +00:00
Weston Ruter d6092d2477 Docs: Improve WP_List_Table and WP_Plugins_List_Table docblocks.
Improve the PHPDoc docblocks in `WP_List_Table` and `WP_Plugins_List_Table` for accuracy, completeness, and consistency with WordPress core documentation standards. Adds missing `@since` tags and corrects several existing versions, adds summary descriptions to all previously bare method and property docblocks, and refines type annotations with precise generic array types.

Developed in https://github.com/WordPress/wordpress-develop/pull/10989.
Follow-up to r30679, r31127, r32642, r32654.

Props huzaifaalmesbah, westonruter, noruzzaman.
See #64896.

Built from https://develop.svn.wordpress.org/trunk@62491


git-svn-id: http://core.svn.wordpress.org/trunk@61772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-11 20:15:43 +00:00
desrosj 8ab36688c3 Build/Test Tools: Include required input for actions/first-interaction.
While not documented as required, both `issue_message` and `pr_message` are required inputs for this action.

Follow up to [62486].

Fixes #65432.
Built from https://develop.svn.wordpress.org/trunk@62490


git-svn-id: http://core.svn.wordpress.org/trunk@61771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-11 19:21:38 +00:00
Weston Ruter 04c7e6c87e Docs: Fix duplicate-word and spelling typos in comments and docblocks.
Developed in https://github.com/WordPress/wordpress-develop/pull/12039.

Props khokansardar, sabernhardt, sanayasir, tusharaddweb.
Fixes #65384.

Built from https://develop.svn.wordpress.org/trunk@62489


git-svn-id: http://core.svn.wordpress.org/trunk@61770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-11 19:09:42 +00:00
Weston Ruter a4b8721037 Cron: Add type definitions to private cron functions.
This addresses PHPStan rule level 10 errors with these functions:

* `_get_cron_array()`
* `_set_cron_array()`
* `_upgrade_cron_array()`

See #64898.

Built from https://develop.svn.wordpress.org/trunk@62488


git-svn-id: http://core.svn.wordpress.org/trunk@61769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-11 18:24:42 +00:00
dmsnell c17bbc57f4 HTML API: Ensure that code points always encode to UTF-8
This was brought up during fuzz testing of the HTML API. After
polyfilling `mb_chr()` and relying on it in the HTML decoder, it became
possible that for sites with a non-UTF-8 charset selected, then the
creation of text from code points when decoding numeric character
references might produce corrupted text, or text which encodes to
non-UTF-8 bytes.

While for these sites, there are broader issues with non-UTF-8 support,
this change ensures that code point encoding remains deterministic.

Developed in: https://github.com/WordPress/wordpress-develop/pull/12155
Discussed in: https://core.trac.wordpress.org/ticket/65372

Follow-up to [62424].

Props dmsnell, jonsurrell.
See #65372.

Built from https://develop.svn.wordpress.org/trunk@62487


git-svn-id: http://core.svn.wordpress.org/trunk@61768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-11 17:05:46 +00:00
desrosj 88bb64f57c Build/Test Tools: Replace abandoned third party action.
The `wow-actions/welcome` action has not been updated for over 2 years and is currently configured to run on `Node20`. With GitHub now actively removing support for Node.js 20.x within the GitHub Actions environment, any action explicitly using `Node20` will break.

This replaces `wow-actions/welcome` with the `actions/first-interaction` action, which is an action officially maintained by GitHub and offers the same functionality.

Props khokansardar, mukesh27, desrosj.
Fixes #65432.
Built from https://develop.svn.wordpress.org/trunk@62486


git-svn-id: http://core.svn.wordpress.org/trunk@61767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-11 14:41:44 +00:00
dmsnell 24dac1cd90 Charset: Replace polyfill wp_has_noncharacters() with direct PCRE version.
Found during fuzzing work on the HTML API and adjacent code. The previous version of this function used a Unicode PCRE to detect noncharacter code points, but that invocation failed if the input string contained sequences of invalid UTF-8 bytes.

This patch replaces the Unicode PCRE with a mapped sequence of raw bytes. This version works in environments without Unicode support and it works when invalid bytes are present, making it possible to remove the fallback function as well.

Developed in: https://github.com/WordPress/wordpress-develop/pull/12148
Discussed in: https://core.trac.wordpress.org/ticket/65372

Follow-up to [61000].

Props dmsnell, jonsurrell.
See #65372.

Built from https://develop.svn.wordpress.org/trunk@62485


git-svn-id: http://core.svn.wordpress.org/trunk@61766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-11 03:17:43 +00:00
dmsnell 13b985d982 Charset: Fix broken test for utf8_decode() fallback.
Detected while fuzz-testing the UTF-8 handling code, this defect meant that the tests were verifying the wrong behavior. Namely, they verified a stringification of ASCII digits, which always converted plainly, when they were meant to test handling of invalid UTF-8 sequences.

This patch fixes the test by calling `chr()` on the byte values before concatenating into a big string.

Developed in: https://github.com/WordPress/wordpress-develop/pull/12147
Discussed in: https://core.trac.wordpress.org/ticket/65372

Props dmsnell, jonsurrell.
Follow-up to: [60950].
See #65372.

Built from https://develop.svn.wordpress.org/trunk@62484


git-svn-id: http://core.svn.wordpress.org/trunk@61765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-10 23:37:43 +00:00
Sergey Biryukov 60338d9b8e Twenty Twenty-One: Add missing documentation for some global variables.
Props sabernhardt, upadalavipul, shailu25, rajinsharwar, audrasjb, viralsampat, noruzzaman, huzaifaalmesbah, SergeyBiryukov.
Fixes #58715.
Built from https://develop.svn.wordpress.org/trunk@62483


git-svn-id: http://core.svn.wordpress.org/trunk@61764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-10 22:35:44 +00:00
dmsnell 6909e6384a General: Add support for unicode email addresses in is_email and sanitize_email
This adds support for the unicode address extensions in RFC 6530-3 and refactors the code so there are fewer long regexes and less duplication between sanitize_email and is_email. A new class, WP_Email_Address, provides the shared parts.

Opting out of unicode support is easy, default-filters.php adds unicode support by adding filters, which can be removed.

`sanitize_email` no longer does major changes like removing an entire subdomain from someone's address, it only cleans up things like soft hyphens and whitespace — changes that happen when coping an email address from text.

Developed in: https://github.com/WordPress/wordpress-develop/pull/5237
Discussed in: https://core.trac.wordpress.org/ticket/31992

Props agulbra, akirk, benniledl, dmsnell, ironprogrammer, justlevine, mdawaffe, mukeshpanchal27, SirLouen, tusharbharti.
Fixes #31992.

Built from https://develop.svn.wordpress.org/trunk@62482


git-svn-id: http://core.svn.wordpress.org/trunk@61763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-10 15:05:45 +00:00
wildworks 9ffa8f1026 Media: Make image editor help icon scheme-aware.
The image editor help toggle icon used a hardcoded classic blue color. Replace it with a CSS custom property so the icon follows the user's admin color scheme.

Props dervishov, huzaifaalmesbah, jamesbregenzer, mukesh27, ozgursar, wildworks.
Fixes #64937.
Built from https://develop.svn.wordpress.org/trunk@62481


git-svn-id: http://core.svn.wordpress.org/trunk@61762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-10 13:31:42 +00:00
joedolson 80cfce4c73 Media: Fix filter toolbar spinner alignment.
The spinner that appeared during filtering was positioned beneath the fields, causing a scrollbar in the filter wrapper container. While only visible during scrolling on MacOS, it was persistently visible on Windows.

Fixes the alignment of the toolbar to appear with predictable alignment to the select fields without generating a scrollbar.

Follow up to [61757].

Props luismulinari, yogeshbhutkar, dhruvang21, r1k0, sabernhardt, wildworks, audrasjb, joedolson.
Fixes #65275. See #23562.
Built from https://develop.svn.wordpress.org/trunk@62480


git-svn-id: http://core.svn.wordpress.org/trunk@61761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-06-10 00:38:44 +00:00