Commit Graph

25040 Commits

Author SHA1 Message Date
John Blackbourn
6d4a349d52 Build/Test Tools: Configure PHPUnit to fail on risky tests.
There should be no need for a risky test to go unseen. It usually signifies a problem in the associated test that needs to be addressed.

See #63167, #63932

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


git-svn-id: http://core.svn.wordpress.org/trunk@60073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-13 15:25:33 +00:00
John Blackbourn
1525fcd7bc Media: Temporarily disable failing tests when Imagick 7 is in use, pending further investigation.
The updated PHP 8.4 and 8.3 containers are running Imagick 7 which is producing some test failures for AVIFs and PNGs with 1-bit transparency. This requires further investigation, possibly accompanied by more comprehensive testing across Imagick versions, so these tests are disabled for now.

Additional missing assertions have also been added which ensure an unexpected `WP_Error` instance correctly fails the test and is not passed to an image processing function.

Props johnbillion, siliconforks, desrosj, jorbin.

See #63932

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


git-svn-id: http://core.svn.wordpress.org/trunk@60072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-13 12:16:24 +00:00
John Blackbourn
a575d6c4bd Build/Test Tools: Switch back to using the latest stable PHP 8.4 and 8.3 images for the test environment.
The underlying issue that caused the MariaDB client in the updated CLI container to no longer trust a self-signed certificate from the MySQL server has been resolved in https://github.com/WordPress/wpdev-docker-images/pull/190.

This change also reinstates the memcached test jobs as the underlying issue where its path resolution was incorrect has been resolved in https://github.com/WordPress/wpdev-docker-images/pull/181.

Props SirLouen, desrosj, johnbillion, kadamwhite, jorbin, davidbaumwald, bernhard-reiter, St. Virtualis of Dockeria

Fizes #63876

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


git-svn-id: http://core.svn.wordpress.org/trunk@60071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-13 12:07:34 +00:00
Sergey Biryukov
27e257c2ad Formatting: Allow specifying https:// as the default protocol in esc_url().
`esc_url()` will now  prepend `https://` to the URL if it does not already contain a scheme and the first item in the `$protocols` array is `'https'`.

Follow-up to [5088], [6015], [13299], [33851], [60672].

Props sabernhardt, mkaz, rachelbaker, audrasjb, costdev, aksl95, johnbillion, pcarvalho, SergeyBiryukov.
Fixes #52886.
Built from https://develop.svn.wordpress.org/trunk@60734


git-svn-id: http://core.svn.wordpress.org/trunk@60070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-12 22:05:28 +00:00
Weston Ruter
2ab6b4ffe5 Posts, Post Types: Fix placement of WP_Error check in get_adjacent_post().
Props kitchin, mindctrl, westonruter, SirLouen, SergeyBiryukov, pmbaldha.
Fixes #63920.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-12 21:18:28 +00:00
Weston Ruter
8526fb29fb Widgets: Prevent fatal errors in PHP 8 when retrieve_widgets() and wp_map_sidebars_widgets() attempt to merge non-array values.
Props kesselb, lakshyajeet, hellofromTonya, janthiel, ikriv, audrasjb, mtg169, bartnv, pmbaldha, mindctrl, westonruter, jrf.
Fixes #57469.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-12 18:05:36 +00:00
Pascal Birchler
7f13088e92 Code Modernization: Fix setAccessible() PHP version comparison in two instances.
Follow-up to [60729].

See #63956.
Built from https://develop.svn.wordpress.org/trunk@60731


git-svn-id: http://core.svn.wordpress.org/trunk@60067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-11 21:10:32 +00:00
Sergey Biryukov
52a82ee7a1 Docs: Correct indentation for a multi-line comment.
Includes reformatting a long conditional for better readability.

Follow-up to [38086], [42343].

Props mukesh27, SergeyBiryukov.
See #63166.
Built from https://develop.svn.wordpress.org/trunk@60730


git-svn-id: http://core.svn.wordpress.org/trunk@60066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-11 15:26:40 +00:00
Pascal Birchler
a47a24cefc Code Modernization: Address reflection no-op function deprecations in PHP 8.5.
`Reflection*::setAccessible()` methods are no-ops since PHP 8.1. This commit adds conditional checks to only call these functions on older PHP versions.

Reference: [https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible PHP RFC: Deprecations for PHP 8.5: Deprecate `Reflection*::setAccessible()`].

Props rishabhwp, swissspidy.
Fixes #63956.
See #63061.
Built from https://develop.svn.wordpress.org/trunk@60729


git-svn-id: http://core.svn.wordpress.org/trunk@60065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-11 14:47:34 +00:00
Pascal Birchler
13828ce4bf I18N: Use Domain Path for script translations if available.
This is a follow-up to [59461] from 6.8, which leveraged `Domain Path` for just-in-time loading of MO/PHP translation files.

Now, the same is done for script translations, which means plugins/themes shipping with their own translation no longer need to manually specify the translation path when calling `wp_set_script_translations()`.

Props tusharbharti, swissspidy, shailu25, jsnajdr.
See #62244, #54797.
Fixes #63944.
Built from https://develop.svn.wordpress.org/trunk@60728


git-svn-id: http://core.svn.wordpress.org/trunk@60064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-11 10:13:27 +00:00
dmsnell
c7d7d6e40c Block Supports: Avoid throwing warning when checking for class attribute as string.
When encountering HTML tags with boolean or missing tags, the get_attribute() method in the HTML API returns true and null, respectively. If these returned values are sent directly into string comparison functions then as of PHP 8.0 they will throw E_DEPRECATED errors.

In this patch, block supports is enhanced to check that the class value is a string before it performs string operations on it.

Also in this patch: using `assertEqualHTML()` in background support test instead of `assertSame()`

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

Props dmsnell, jonsurrell, hellofromtonya, peterwilsoncc.
Fixes #59622.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-10 20:27:32 +00:00
Sergey Biryukov
1e6f8ec30b Coding Standards: Simplify a conditional in get_url_in_content().
As there's an `is_string()` check already, `! empty( $href )` can be simplified to a string comparison, as the other variable types that are checked in `empty()` won't appear.

`empty()` also returns `false` for the string `"0"` which would however be a valid (relative) URL and thus should be detectable by the function.

Follow-up to [60665].

Props TobiasBg.
Fixes #63694.
Built from https://develop.svn.wordpress.org/trunk@60726


git-svn-id: http://core.svn.wordpress.org/trunk@60062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-10 03:17:33 +00:00
Sergey Biryukov
072f79dd00 Upgrade/Install: Cast get_option( 'active_plugins' ) to array in upgrade_690().
This resolves an error on Multisite networks where an individual site doesn't have plugins active:
{{{
array_search(): Argument #2 ($haystack) must be of type array, string given
}}}

Follow-up to [60666], [60721].

Props dd32.
See #53323.
Built from https://develop.svn.wordpress.org/trunk@60725


git-svn-id: http://core.svn.wordpress.org/trunk@60061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-09 15:34:31 +00:00
Sergey Biryukov
13f62d78ac Docs: Correct the order of @see and @global tags in some files.
Follow-up to [28656], [29090].

Props shailu25, mukesh27.
See #63166.
Built from https://develop.svn.wordpress.org/trunk@60724


git-svn-id: http://core.svn.wordpress.org/trunk@60060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-09 14:33:29 +00:00
davidbaumwald
9ceab322ad Plugins: Correct deactivate row action text when network active.
Specifically, this change when a network activated plugin has plugin dependencies, the disabled deactivate row action link text is changed from "Deactivate" to "Network Deactivate".

Follow-up to [57545].

Props pbiron, nikunj8866, shailu25, jjj.
Fixes #63942.
Built from https://develop.svn.wordpress.org/trunk@60723


git-svn-id: http://core.svn.wordpress.org/trunk@60059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-08 20:58:38 +00:00
jonsurrell
33e7fbc1a9 Script Loader: Fix typo in code comment about sourceURL.
Developed in https://github.com/WordPress/wordpress-develop/pull/9794.

Follow-up to [60719].

Props jonsurrell, tobiasbg.
See #63887.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-08 14:30:26 +00:00
Sergey Biryukov
57e2365030 Upgrade/Install: Correct the database upgrade routine for WordPress 6.9.
This commit:
* Moves the call to `upgrade_690()` to the correct place so it actually gets called.
* Wraps Hello Dolly upgrade code in a version check per standard practice.
* Removes the `$wpdb->query()` call to avoid attempting to create the new index twice, once in the upgrade and once in `dbDelta()`.

Follow-up to [60666], [60716], [60717].

Props peterwilsoncc, mukesh27.
See #50161, #53323.
Built from https://develop.svn.wordpress.org/trunk@60721


git-svn-id: http://core.svn.wordpress.org/trunk@60057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-08 13:47:39 +00:00
gziolo
f7652f9cd8 Tests: Update rendering test cases for Block Bindings
Refactoring covered:

- Use the newly introduced `block_bindings_supported_attributes_{$block_name}` filter to register a `test/block`'s attribute as supported by Block Bindings, rather than using an actual block (Paragraph) for most tests.
- Merge three test cases that check if `get_value_callback` works correctly (accepts arguments; correctly includes symbols and numbers; return value is sanitized when rendered) into one, by using a `dataProvider`.
- Merge two test cases that check if block context is correctly evaluated, and that access is only given to context included in a source's `uses_context` property.

Follow-up to [60684].

Props bernhard-reiter, gziolo.
See #63840.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-08 11:29:22 +00:00
jonsurrell
ec862f5d99 Script Loader: Add sourceURL to inline scripts and styles.
Improve the source locations referenced by developer tooling in supporting browsers. Inline source locations are named like inline:handle-js-after and appear in the developer tools "sources" panel.

This is the second attempt to add sourceURL comments. The first attempt in [60685] was reverted due to an issue with script concatenation that has been addressed.

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

Follow-up to [60685], [60690].

Props jonsurrell, westonruter, wildworks, peterwilsoncc, johnbillion, tobiasbg.
Fixes #63887.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-08 11:27:31 +00:00
Sergey Biryukov
a2cceecbdd Database: Update $wp_db_version to point to the correct commit number.
Follow-up to [60717].

See #50161.
Built from https://develop.svn.wordpress.org/trunk@60718


git-svn-id: http://core.svn.wordpress.org/trunk@60054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-07 20:39:20 +00:00
Sergey Biryukov
d54706b43c Database: Add type_status_author index for the posts table.
This aims to improve performance of some queries on installations with a large number of posts.

Follow-up to [3678], [3690], [9290], [13576].

Props josephscott, LucasMS, Otto42, flixos90, matt, johnjamesjacoby, siliconforks, mukesh27,  jonsurrell, SirLouen, SergeyBiryukov.
Fixes #50161.
Built from https://develop.svn.wordpress.org/trunk@60717


git-svn-id: http://core.svn.wordpress.org/trunk@60053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-07 20:36:20 +00:00
Sergey Biryukov
ff865046b7 Coding Standards: Move upgrade_690() to the correct place, after upgrade_682().
Follow-up to [60666].

See #53323.
Built from https://develop.svn.wordpress.org/trunk@60716


git-svn-id: http://core.svn.wordpress.org/trunk@60052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-07 20:34:35 +00:00
joedolson
ff7cfc9145 Customizer: Accessible errors when adding new pages.
When setting the home page settings or dynamically adding new pages in the menu manager, the error messages didn't meet accessibility standards.

Add a screen reader announcement, a visible notification, and standardize the error styles.

Props dilipbheda, dlh, celloexpressions, joedolson, jeremiahbratton, shailu25.
Fixes #50696.
Built from https://develop.svn.wordpress.org/trunk@60715


git-svn-id: http://core.svn.wordpress.org/trunk@60051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-07 02:47:36 +00:00
Sergey Biryukov
51ee5c3a5d Docs: Add @param and @return description for sanitize_hex_color_no_hash().
Follow-up to [20936], [21354], [37283], [60709].

Props rollybueno, SergeyBiryukov.
See #63166.
Built from https://develop.svn.wordpress.org/trunk@60714


git-svn-id: http://core.svn.wordpress.org/trunk@60050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-06 21:58:30 +00:00
Weston Ruter
275127f8b3 Posts, Post Types: Use relevant HTTP status codes for wp_die() calls in wp-admin/post.php.
The status code is now explicitly set in each `wp_die()` call so that the default 500 status code is not sent unless it is the most appropriate.

Props callumbw95, kkmuffme, mindctrl, westonruter.
Fixes #63836.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-06 06:49:31 +00:00
davidbaumwald
cd68f370e9 Users: Pass WP_User object to wp_set_password action in during new user creation.
After [60634], `wp_set_password` is now fired during new user creation and existing user updates when a password is changed.  `wp_set_password` expects the third argument to be a `WP_User` object of the user's data prior to the update.  This change simply passes the newly created `WP_User` object.

Follow-up to [60634].

Props dd32.
See #22114.
Built from https://develop.svn.wordpress.org/trunk@60712


git-svn-id: http://core.svn.wordpress.org/trunk@60048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-05 18:06:49 +00:00
Sergey Biryukov
1b4c99fd92 Taxonomy: Add update_term_count action that fires when term counts are updated.
This allows plugins to run custom queries only when a term count is actually updated and not on every update of terms or posts.

Follow-up to [60365], [60510].

Props leonidasmilossis, peterwilsoncc, mukesh27, rollybueno, SergeyBiryukov.
Fixes #63904.
Built from https://develop.svn.wordpress.org/trunk@60711


git-svn-id: http://core.svn.wordpress.org/trunk@60047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-05 13:30:39 +00:00
joedolson
cb59d63c60 Administration: Remove unused CSS in forms.css.
Remove some CSS that doesn't appear to have ever been used. See [42967].

Props joedolson, peterwilsoncc, mukesh27.
Fixes #63907.
Built from https://develop.svn.wordpress.org/trunk@60710


git-svn-id: http://core.svn.wordpress.org/trunk@60046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-05 04:03:29 +00:00
Sergey Biryukov
501ef81f28 Docs: Add @param and @return description for maybe_hash_hex_color().
Follow-up to [20936], [21354], [37283].

Props rollybueno, SergeyBiryukov.
See #63166.
Built from https://develop.svn.wordpress.org/trunk@60709


git-svn-id: http://core.svn.wordpress.org/trunk@60045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-04 20:06:38 +00:00
jonsurrell
0c8242eb68 Editor: Use Unicode escape encoding for "\" characters in block attributes.
Corrects an issue with block attribute encoding where JSON strings ending in the `\` character would be misencoded and cause block attributes to be lost.

Client-side block serialization was updated with matching logic in 10453ab3a4.

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

Props jonsurrell, westonruter, mamaduka, dmsnell, shailu25.
Fixes #63917.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-04 18:32:39 +00:00
jonsurrell
725a319a88 Build/Test Tools: Ensure assertEqualHTML fallback render can be reached.
`assertEqualHTML` catches `Exception`s and attempts to re-parse the HTML with the `Dom\HtmlDocument` class. Ensure that the fallback render is reachable by throwing `Exception` instead of `Error` in the tree builder function.

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

Follow-up to [60295].

Props jonsurrell, bernhard-reiter, dmsnell.
Fixes #63527.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-04 14:50:21 +00:00
jonsurrell
d4a1644618 HTML API: Prevent adding dangerous double-escape SCRIPT contents.
Prevent WP_Tag_Processor::set_modifiable_text() from allowing SCRIPT contents with "<script" like it does with "</script". Either of these sequences may affect the script element's close.

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

Props jonsurrell, westonruter, dmsnell.
See #63738.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-04 14:40:27 +00:00
joedolson
e30a48d6b0 Administration: Fix sizing of page header links on mobile.
Page title actions were modified to match the global button styles in #41986, but these styles were not applied to mobile viewports at the time. 

Fix padding, height, line-height, and alignment to match these links to global styles. 

Props joedolson, rollybueno, sumitbagthariya16, circlecube, shailu25.
Fixes #63831.
Built from https://develop.svn.wordpress.org/trunk@60705


git-svn-id: http://core.svn.wordpress.org/trunk@60041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-04 03:53:36 +00:00
Weston Ruter
c97bb4a4bd Script Loader: Introduce fetchpriority for Scripts and Script Modules.
* Allow scripts and script modules to be registered with a `fetchpriority` of `auto` (default), `high`, `low`:
  * When registering a script, add a `fetchpriority` arg to go alongside the `strategy` arg which was added for loading scripts with the `defer` and `async` loading strategies. See #12009. 
  * For script modules, introduce an `$args` array parameter with a `fetchpriority` key to the `wp_register_script_module()`, and `wp_enqueue_script_module()` functions (and their respective underlying `WP_Script_Modules::register()` and `WP_Script_Modules::enqueue()` methods). This `$args` parameter corresponds with the same parameter used when registering non-module scripts.
  * Also for script modules, introduce `WP_Script_Modules::set_fetchpriority()` to override the `fetchpriority` for what was previously registered.
  * Emit a `_doing_it_wrong()` warning when an invalid `fetchpriority` value is used, and when `fetchpriority` is added to a script alias.
  * Include `fetchpriority` as an attribute on printed `SCRIPT` tags as well as on preload `LINK` tags for static script module dependencies.
* Use a `fetchpriority` of `low` by default for:
  * Script modules used with the Interactivity API. For overriding this default in blocks, see [https://github.com/WordPress/gutenberg/issues/71366 Gutenberg#71366].
  * The `comment-reply` script.
* Improve type checks and type hints.

Developed in [https://github.com/WordPress/wordpress-develop/pull/8815 GitHub PR], with [https://github.com/WordPress/gutenberg/pull/70173 companion for Gutenberg].

Props westonruter, jonsurrell, swissspidy, luisherranz, kraftbj, audrasjb, dennysdionigi.
Fixes #61734.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-03 22:17:39 +00:00
Sergey Biryukov
126fc3b4ca Code Modernization: Address no-op function deprecations in PHP 8.5.
Several PHP functions that have not been doing anything since PHP 8.0/8.1, specifically:

* `finfo_close()` since the `ext/fileinfo` migration in PHP 8.1
* `xml_parser_free()` since the `ext/xml` migration in PHP 8.0
* `curl_close()` since the `ext/curl` migration in PHP 8.0
* `curl_share_close()` since the `ext/curl` migration in PHP 8.0
* `imagedestroy()` since the `ext/gd` migration in PHP 8.0

will be deprecated in PHP 8.5 and will thus be throwing warnings.

This commit adds conditional checks to only call these functions on the relevant PHP versions.

Reference: [https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_no-op_functions_from_the_resource_to_object_conversion PHP RFC: Deprecations for PHP 8.5: Deprecate no-op functions from the resource to object conversion].

Props TobiasBg, SergeyBiryukov.
See #63061.
Built from https://develop.svn.wordpress.org/trunk@60703


git-svn-id: http://core.svn.wordpress.org/trunk@60039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-03 12:18:31 +00:00
dmsnell
1ee96aa7df Charset: Add explanatory note about what consitutes “valid” UTF-8.
This patch adds a clarifying note about what constitutes a valid UTF-8 byte stream. This was brought up in review as a potentially ambiguous term, so a link to the spec has been provided to fix the behavior to the standard.

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

Follow-up to [60630].

Props dmsnell, agulbra.
See #38044.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-02 23:53:30 +00:00
Sergey Biryukov
501fa4bd4e Posts, Post Types: Check the result of creating a draft in get_default_post_to_edit().
As `wp_insert_post()` can return an error for various reasons, this commit ensures that this scenario is properly handled and an error message is displayed.

Follow-up to [12987].

Props rishabhwp, tfrommen, SirLouen, siliconforks, SergeyBiryukov.
Fixes #37441.
Built from https://develop.svn.wordpress.org/trunk@60701


git-svn-id: http://core.svn.wordpress.org/trunk@60037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-02 16:50:32 +00:00
joedolson
cc73b8b920 Accessibility: Feedback & focus on deleting terms via AJAX.
When deleting a term using AJAX, notify screen reader users of the deletion using `wp.a11y.speak()`, set the active row to be unfocusable, then explicitly set new focus after the deletion is completed.

Props jeremyfelt, afercia, wido, nikunj8866, SirLouen, pmbaldha, joedolson.
Fixes #47101.
Built from https://develop.svn.wordpress.org/trunk@60700


git-svn-id: http://core.svn.wordpress.org/trunk@60036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-01 21:22:31 +00:00
Sergey Biryukov
b96550533f Tests: Remove redundant @covers tags in wp_mail() tests.
`@covers` has already been added at the class level, so there is no need to add it to individual unit tests.

Follow-up to [54702], [60698].

Props mukesh27.
See #28059.
Built from https://develop.svn.wordpress.org/trunk@60699


git-svn-id: http://core.svn.wordpress.org/trunk@60035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-01 18:05:28 +00:00
TimothyBlynJacobs
6fc14a44cf Mail: Support inline attachments.
MIME allows for referencing included attachments by their `Content-ID` header using the `cid` URL scheme. This can be used to embed images inline to the HTML message. For example, `<img src="cid:logo">`, will display the contents of message part with the `Content-Id: <logo>` header.

The `wp_mail()` function now supports including inline attachments through a new `$embeds` parameter. It accepts a map of `Content-ID` values to file paths. The `wp_mail_embed_args` filter can be used to customize the resulting `PHPMailer::addEmbeddedImage` method call.

Props jesin, swissspidy, chrisvendiadvertisingcom, SirLouen, mukesh27, yashjawale, iamadisingh.
Fixes #28059.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-09-01 04:04:29 +00:00
spacedmonkey
6c7025eeb5 Caching API: Use consistent cache keys for query groups.
Query-based caches are now improved by reusing cache keys. Previously, cache keys for query caches were generated using the `last_changed` value as part of the key. This meant that whenever `last_changed` was updated, all the previously cached values for the group became unreachable.

The new approach allows WordPress to replace previously cached results that are known to be stale. The previous approach relied on the object cache backend evicting stale keys which is done at various levels of efficiency.

To address this, the following new helper functions have been introduced:

* wp_cache_get_salted
* wp_cache_set_salted
* wp_cache_get_multiple_salted
* wp_cache_set_multiple_salted 

These functions provide a consistent way to get/set query caches. Instead of using the last_changed value as part of the cache key, it is now stored inside the cache value as a "salt". This allows cache keys to be reused, with values updated in place rather than relying on eviction of outdated entries.

Props spacedmonkey, peterwilsoncc, flixos90, sanchothefat, tillkruess, rmccue, mukesh27, adamsilverstein, owi, nickchomey.
Built from https://develop.svn.wordpress.org/trunk@60697


git-svn-id: http://core.svn.wordpress.org/trunk@60033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-08-31 21:43:30 +00:00
Sergey Biryukov
57f78b73af Docs: Clarify return value for wp_get_default_extension_for_mime_type().
Follow-up to [51653].

Props rollybueno, SergeyBiryukov.
See #63166.
Built from https://develop.svn.wordpress.org/trunk@60696


git-svn-id: http://core.svn.wordpress.org/trunk@60032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-08-31 18:55:26 +00:00
dmsnell
a9661d650c Formatting: Rely on _wp_can_use_pcre_u() to detect UTF-8 PCRE support.
The `sanitize_file_name()` function attempts to detect UTF-8 PCRE support, but WordPress already provides a more robust method. It then caches its check in a static var, which WordPress already does in the canonical function `_wp_can_use_pcre_u()`.

This patch refactors `sanitize_file_name()` to call `_wp_can_use_pcre_u()` directly instead of (mostly) recreating and recaching Core’s detection algorithm.

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

Follow-up to [60694].

Props dmsnell.
See #63863.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-08-31 06:05:30 +00:00
dmsnell
5fa2d232eb Compat: Replace warning-suppression in _wp_can_use_pcre_u()
This patch replaces the use of the problematic error-suppresssion operator with a specific error-handler to catch and report Unicode PCRE support without raising the related issues of error-suppression: notably conflating errors and failing to prevent completely the logging of the warnings.

In this case, the WPCS rule against using error-suppression was actually helpful in pointing out the risk, but the code was left in place with an “ignore” comment to silence the violation; this patch addresses the risk and removes the need for the comment.

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

Follow-up to: [45611].

Props dmsnell.
Fixes #63865.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-08-30 20:53:31 +00:00
Sergey Biryukov
a1ff962773 Build/Test Tools: Check if PHPUnit classes exist before calling class_alias().
This resolves `Class not found` warnings when running the tests in PHPUnit 10 or later.

Follow-up to [40536], [51570].

Props danielmorell, devasheeshkaul, SergeyBiryukov.
Fixes #63833.
Built from https://develop.svn.wordpress.org/trunk@60693


git-svn-id: http://core.svn.wordpress.org/trunk@60029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-08-30 14:01:29 +00:00
desrosj
3ba0c58c13 Build/Test Tools: Update third-party GitHub Actions.
This updates the following third-party actions to their latest versions:
`actions/checkout` from `4.2.2` to `5.0.0`
`shivammathur/setup-php` from `2.32.0` to `2.35.3`
`actions/setup-node` from `4.3.0` to `4.4.0`
`ramsey/composer-install` from `3.1.0` to `3.1.1`
`actions/cache` from `4.2.3` to `4.2.4`
`actions/download-artifact` from `4.2.1` to `5.0.0`
`codecov/codecov-action` from `5.4.0` to `5.4.3`
`slackapi/slack-github-action` from `2.0.0` to `2.1.1`

See #63170.
Built from https://develop.svn.wordpress.org/trunk@60692


git-svn-id: http://core.svn.wordpress.org/trunk@60028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-08-30 00:13:29 +00:00
desrosj
4a58a4c6fd Security: Update composer/ca-bundle to version 1.5.8.
See #63165.
Built from https://develop.svn.wordpress.org/trunk@60691


git-svn-id: http://core.svn.wordpress.org/trunk@60027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-08-29 23:59:30 +00:00
jonsurrell
2c4aab7e8c Script Loader: Revert sourceURL addition.
It was discovered that these changes cause some issues in the customizer when `SCRIPT_DEBUG` is `false`.

Reverts [60685] and [60686].

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

Props jonsurrell, wildworks, tyxla.
See #63887.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-08-29 17:18:28 +00:00
Sergey Biryukov
7b891912c7 Tests: Correct @covers tags for term_exists() tests.
Includes moving the tag to the class DocBlock, as this test class covers a single function.

Follow-up to [52921], [60676].

See #63167.
Built from https://develop.svn.wordpress.org/trunk@60689


git-svn-id: http://core.svn.wordpress.org/trunk@60025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-08-29 12:52:27 +00:00
Bernhard Reiter
c90da2b673 Block Hooks: Apply block hooks to plugin-registered templates.
As of WordPress 6.7.0, it is possible -- e.g. for plugins -- to register block templates via a new API, `register_block_template()`. Unlike block templates loaded from theme files or from the database, however, those block templates didn't have Block Hooks applied. This changeset rectifies this inconsistency.

Props iamadisingh, aljullu, bernhard-reiter.
Fixes #63808.
Built from https://develop.svn.wordpress.org/trunk@60688


git-svn-id: http://core.svn.wordpress.org/trunk@60024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-08-28 19:10:33 +00:00