Commit Graph

37252 Commits

Author SHA1 Message Date
Sergey Biryukov 8385861e3d Docs: Clarify the description for `wp_dropdown_users()`.
Follow-up to [8873].

See #61608.
Built from https://develop.svn.wordpress.org/trunk@58955


git-svn-id: http://core.svn.wordpress.org/trunk@58351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-30 17:31:18 +00:00
Sergey Biryukov d564af0c7b Tests: Clarify description for `unregister_setting()` test with an unknown setting.
Follow-up to [56817].

See #61530.
Built from https://develop.svn.wordpress.org/trunk@58954


git-svn-id: http://core.svn.wordpress.org/trunk@58350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-29 23:28:18 +00:00
Pascal Birchler 923afba171 Docs: Remove `@global` annotation after [58952].
Props mukesh27.
See #60970.
Built from https://develop.svn.wordpress.org/trunk@58953


git-svn-id: http://core.svn.wordpress.org/trunk@58349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-29 06:16:09 +00:00
Pascal Birchler 6665a4e30a Script Loader: Remove `importmap` polyfill.
The polyfill was added in [57492], but all browsers supported by WordPress already support import maps.

This not only disables the polyfill, but completely removes it as it was only added recently and there is no usage outside of core.

Props swissspidy, desrosj, luisherranz, gziolo.
Fixes #60970.
Built from https://develop.svn.wordpress.org/trunk@58952


git-svn-id: http://core.svn.wordpress.org/trunk@58348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-29 06:06:13 +00:00
ramonopoly 94b9ccd020 Block Styles: Ensure unique classname generation for variations
This commit simplifies block style variation class name generation to ensure unique class names by replacing the hashing of block attributes in the block style variation class names with a call to `wp_unique_id`.

Doing so avoids potential for non-unique class names and conflicting styles when exact copies of a block are inserted via a repeated pattern.


Props aaronrobertshaw, martinkrcho, mukesh27, peterwilsoncc, ramonopoly.

Fixes #61877.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-29 05:41:10 +00:00
ramonopoly 06e50d2cbb Fluid typography: allow individual preset overrides
In theme.json, individual font sizes may opt out of fluid typography if it is turned on globally.  

This commit ensures that individual font size presets can also opt in to fluid typography if it is not turned on globally. 

Props aaronrobertshaw, mmaattiiaass, ramonopoly, wildworks.

Fixes #61932.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-29 05:22:14 +00:00
Felix Arntz 4d0a623d7a Options, Meta APIs: Soft-deprecate use of 'yes' and 'no' as `$autoload` parameter.
WordPress 6.6 option autoload enhancements included discouraging the use of 'yes' and 'no' to indicate whether to autoload an option when calling `add_option()` or `update_option()`. Instead, a boolean should be used.

This changeset brings the newer autoload related functions `wp_set_option_autoload_values()`, `wp_set_options_autoload()`, and `wp_set_option_autoload()` in line with those changes. Additionally, it soft-deprecates the values more formally, as they should no longer be used. No PHP warnings will be emitted though as this is not a hard deprecation. This change is purely about documentation.

Props flixos90, joemcgill, jrf, mukesh27.
Fixes #61929.
See #61103, #61939.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-28 22:48:18 +00:00
Sergey Biryukov d79898ec1b Docs: Remove obsolete `@todo` entry in REST API post meta tests.
Follow-up to [56714].

See #61608.
Built from https://develop.svn.wordpress.org/trunk@58948


git-svn-id: http://core.svn.wordpress.org/trunk@58344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-28 21:53:14 +00:00
antpb 81cfe7488c Media: Implement fallback to full-size thumbnails for PDFs in Media Library.
When medium-size thumbnails are disabled, PDF previews in the Media Library grid view now fall back to displaying full-size thumbnails instead of a generic document icon.

Props daleharrison, kushang78, mukesh27, sudipatel007, mai21, antpb.
Fixes #39630.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-28 17:01:13 +00:00
joedolson e57bee933a Media: Fix viewport scrolling and code style in image rotation.
Change `browsePopup` to use `onkeydown`, pass the `event` parameter from the calling control, and adjust variable naming style.

The `browsePopup` method used for the image rotation menu used `onkeyup` to trigger events, which prevented capturing browser scroll actions with arrows occurring on `onkeydown`.

Props afercia, deepakvijayan, nirajgirixd, joedolson, antpb.
Fixes #60548.
Built from https://develop.svn.wordpress.org/trunk@58946


git-svn-id: http://core.svn.wordpress.org/trunk@58342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-28 16:45:11 +00:00
Felix Arntz 05541b406c Options, Meta APIs: Stop using 'yes' and 'no' for autoload parameter in favor of recommended boolean.
This changeset does not modify any behavior, it only updates the code to use the recommended type for the `$autoload` parameter as of WordPress 6.6. The old values 'yes' and 'no' are only maintained in certain tests that are explicitly about these backward compatibility values.

Props flixos90, joemcgill, mukesh27.
Fixes #61939.
See #61103, #61929.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-28 16:41:16 +00:00
Aaron Jorbin 4065eb8bc4 Bootstrap/Load: Add Words of warning about load order.
Since this file is loaded incredibly early, many functions are not available. Those deeply familiar with how load works might have some idea as to what's safe and what isn't, but it's generally confusing and a little opaque so let's warn people there be dragons.

Props helen, DrewAPicture, jorbin.
Fixes #38650.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-28 14:36:17 +00:00
Sergey Biryukov af0ddfb337 Twenty Nineteen: Remove the use of empty rulesets.
Follow-up to [43808].

Props pitamdey, mukesh27, narenin.
Fixes #61933.
Built from https://develop.svn.wordpress.org/trunk@58943


git-svn-id: http://core.svn.wordpress.org/trunk@58339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-27 19:36:14 +00:00
Pascal Birchler 89519c939c Docs: Fix typo in `wp_show_heic_upload_error` docblock.
Follow-up to [58849].
See #53645.
Built from https://develop.svn.wordpress.org/trunk@58942


git-svn-id: http://core.svn.wordpress.org/trunk@58338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-27 15:29:14 +00:00
dmsnell b8dbab9546 Add Adam Zieliński to the mailmap file.
Adds Adam Zieliński's display name to the `.mailmap` file.

Developed in https://github.com/wordpress/wordpress-develop/7204
Discussed in https://core.trac.wordpress.org/ticket/61864

Follow-up to [58899].

Props dmsnell, zieladam.
See #61864.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-27 03:44:10 +00:00
dmsnell 813d784931 HTML API: Fix a bug where the namespace was forced to 'html'
While working on other reviews and audits, a bug was discovered in the HTML API where the wrong namespace was being assigned to a token because the default value of 'html' was used. This patch fixes the bug by calling the `parent::get_namespace()` method instead of assuming 'html'.

Developed in https://github.com/wordpress/wordpress-develop/7232
Discussed in https://core.trac.wordpress.org/ticket/61576

Follow-up to [58868].

Props jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-27 03:37:12 +00:00
Peter Wilson bd20e0e8d2 Build/test tools: Remove prompt for trac ticket referenced with ticket: prefix.
Prevents the GitHub bot from posting a comment on pull requests requesting a trac ticket link if the ticket description includes a link via the ticket: prefix, eg ticket:61865.

The WordPress/WordPress-Develop repository is configured to automatically convert the text to a trac ticket link.

Props dd32, peterwilsoncc.
Fixes #61865.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-26 23:16:15 +00:00
Sergey Biryukov 3014749ed9 Coding Standards: Use a human-readable constant in the check for max memory limit.
Follow-up to [35286], [38011], [38015], [58937].

See #61607.
Built from https://develop.svn.wordpress.org/trunk@58938


git-svn-id: http://core.svn.wordpress.org/trunk@58334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-26 20:57:13 +00:00
Felix Arntz ddd7f2142e Administration: Avoid using `WP_MAX_MEMORY_LIMIT` default that is smaller than `WP_MEMORY_LIMIT`.
Props eclare, dd32, pbearne.
Fixes #36426.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-26 20:14:14 +00:00
ramonopoly 9e650efbb8 Background images: resolve theme.json dynamic ref values and ensure appropriate style default values
The commit syncs the following changes from Gutenberg:

- Background images: add support for theme.json ref value resolution gutenberg#64128
- Background images: ensure appropriate default values gutenberg#64192
- Background image: ensure consistency with defaults and fix reset/remove functionality gutenberg#64328

These changes brings consistency to the default background image styles WordPress applies to user uploaded images, and adds support for ref resolution to "background" style properties.

Props andrewserong, aaronrobertshaw.  

Fixes #61858



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


git-svn-id: http://core.svn.wordpress.org/trunk@58332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-26 05:40:16 +00:00
Peter Wilson 0735fa8ce0 Script Loader: Refactor Etag generation for concatenated assets.
Move Etag HTTP header generation in `load-scripts.php` and `load-styles.php` to `WP_Dependencies`.

Introduces the method `WP_Dependencies::get_etag()` and associated unit tests.

Follow up to [57943].

Props vrajadas, martinkrcho, mukesh27.
Fixes #61485.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-25 23:48:13 +00:00
Peter Wilson fd94bc45c6 HTTP API: Update `wp_http_supports()` to use Requests.
Update the capabilities check in `wp_http_supports` to use `WpOrg\Requests\Requests::has_capabilities` rather than the deprecated `WP_HTTP::_get_first_available_transport()`.

Props dd32, mukesh27, costdev, desrosj, johnbillion, jorbin, jrf, chaion07.
Fixes #37708.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-25 23:13:17 +00:00
TimothyBlynJacobs a0e8d31590 REST API: Improve error messages when registering an invalid route.
The error messages now include the REST API namespace and route to help identify the offending code.

Props lwangaman, timothyblynjacobs.
Fixes #50493.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-25 22:51:14 +00:00
Sergey Biryukov a45c25d272 Script Loader: Do not normalize absolute paths in inline block styles CSS.
`_wp_normalize_relative_css_links()` used to normalize all non-absolute URLs regardless of whether it's a relative path or an absolute path. The normalization should only happen for relative paths (paths without a leading `/`) and not for absolute paths.

Reference: [https://www.rfc-editor.org/rfc/rfc1808#section-4 RFC 1808, Section 4, Step 4].

Follow-up to [52036], [52695], [52754], [55658], [55669].

Props scholdstrom.
Fixes #61909.
Built from https://develop.svn.wordpress.org/trunk@58932


git-svn-id: http://core.svn.wordpress.org/trunk@58328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-25 22:48:15 +00:00
Peter Wilson ac72a65949 Comments: Announce reply notices to screen reader users.
Improve experience for screen reader users by calling `wp.a11y.speak()` with the results of comment reply submissions within the WordPress dashboard.

Props joedolson, khokansardar.
Fixes #61480.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-25 22:37:19 +00:00
Tammie Lister f51cc56803 Twenty Seventeen: Fixes search block button styling variations.
The search block button was not the same back and front for background, text and font weight. This is an additional patch solving the previous issue of styles being in wrong section and also differences..

Props sabernhardt.
Fixes #61888.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-24 12:21:15 +00:00
Sergey Biryukov b754603f04 Toolbar: Use CSS variable for the admin bar height in `wp-admin/css/common.css`.
Follow-up to [16600], [21025], [26072].

Props tdrayson, niravsherasiya7707, mukesh27.
See #61898.
Built from https://develop.svn.wordpress.org/trunk@58929


git-svn-id: http://core.svn.wordpress.org/trunk@58325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-24 00:05:12 +00:00
Sergey Biryukov 9c0e9fb055 Upgrade/Install: Use an empty string for the default “Post via email” password.
This aims to avoid a security warning in Chrome, which could previously be triggered even if the default value is not actually used as a password.

Follow-up to [208], [230], [233], [662], [1599], [1601]

Props adamkheckler, sabernhardt, peterwilsoncc, psykro, petitphp.
Fixes #61332.
Built from https://develop.svn.wordpress.org/trunk@58928


git-svn-id: http://core.svn.wordpress.org/trunk@58324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-23 23:17:13 +00:00
Peter Wilson d1386fb88c Administration: Modernize Site Icon UI in settings, customizer.
Updates the UI for previewing a site icon in general settings and the customizer to account for changes to browser designs over the past years.

Props joedolson, joen, kebbet, nhrrob, swissspidy, mukesh27, afercia, jorbin.
Fixes #60625.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-23 22:47:16 +00:00
dmsnell 01d2199622 HTML API: Add support for missing FRAMESET and "after" insertion modes.
As part of work to add more spec support to the HTML API, this patch adds support for the FRAMESET-related insertion modes, as well as the set of missing after insertion modes. These modes run at the end of parsing a document, closing it and taking care of any lingering tags.

Developed in https://github.com/wordpress/wordpress-develop/7165
Discussed in https://core.trac.wordpress.org/ticket/61576

Props dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-23 15:42:17 +00:00
dmsnell e3a3c13497 HTML API: Parse DOCTYPE tokens and set HTML parser mode accordingly.
This patch adds until-now missing code to parse the structure of HTML DOCTYPE declarations. The DOCTYPE is mostly unused but can dictate the document compatability mode, which governs whether CSS class names match in a ASCII-case-insensitive way or not, and whether TABLE elements close an open P element.

The DOCTYPE information is made available through a new method on the Tag Processor, `get_doctype_info()`.

Developed in https://github.com/wordpress/wordpress-develop/pull/7195
Discussed in https://core.trac.wordpress.org/ticket/61576

Props dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-23 14:55:15 +00:00
Sergey Biryukov 83c2045588 Docs: Correct inline comment formatting in `redirect_canonical()`.
Follow-up to [57357].

See #61608.
Built from https://develop.svn.wordpress.org/trunk@58924


git-svn-id: http://core.svn.wordpress.org/trunk@58320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-22 23:47:15 +00:00
Peter Wilson 78a0c7a5b3 Date/Time: Prevent type errors in `current_time()`.
Prevents a potential type error when calling `current_time( 'timestamp' )` by casting `get_option( 'gmt_offset' )` to a float prior to performing calculations with the value.

This mainly accounts for incorrect storage of values, such as an empty string or city name.

Follow up to [45856], [55054], [55598].

Props hellofromtonya, peterwilsoncc, rarst, costdev, Nick_theGeek, SergeyBiryukov, johnbillion, desrosj, reputeinfosystems, audrasjb, oglekler.
Fixes #57035.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-22 23:27:24 +00:00
Pascal Birchler 2531f22a15 I18N: Add hardening for invalid meta lines in MO files.
Props swissspidy, pander.
Fixes #61794.
Built from https://develop.svn.wordpress.org/trunk@58922


git-svn-id: http://core.svn.wordpress.org/trunk@58318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-22 08:08:28 +00:00
Sergey Biryukov cddaa30f95 Site Health: Check if the directories are allowed when testing for a VCS checkout.
As part of determining whether to perform automatic updates, WordPress checks if it is running within a version-controlled environment, recursively looking up the filesystem to the top of the drive, looking for a Subversion, Git, Mercurial, or Bazaar directory, erring on the side of detecting a VCS checkout somewhere.

This commit reuses `WP_Automatic_Updater::is_allowed_dir()` in the Site Health test to avoid a PHP warning if the `open_basedir` directive is in use and any of the directories checked in the process are not allowed:
{{{
is_dir(): open_basedir restriction in effect. File(/.git) is not within the allowed path(s)
}}}

Follow-up to [44986], [55425].

Props Keffr3n, narenin.
Fixes #61834.
Built from https://develop.svn.wordpress.org/trunk@58921


git-svn-id: http://core.svn.wordpress.org/trunk@58317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-21 22:23:16 +00:00
hellofromTonya 337bee97b7 Tests: Remove 'errors' assertion when not WP_Error in Tests_Term_WpInsertTerm.
Removes the assertion for 'errors' being empty when the instance is `WP_Term` and not `WP_Error`. This property exists on `WP_Error`.

This assertion always passed because it was checking a dynamic property on `WP_Term` that does not exist and is not added within Core. Thus, this assertion is not needed and fails with dynamic property deprecations.

Follow-up to [51403], [34646], [29830].

See #61890, #61530.
Built from https://develop.svn.wordpress.org/trunk@58920


git-svn-id: http://core.svn.wordpress.org/trunk@58316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-21 21:06:16 +00:00
hellofromTonya 84e11e89c0 Tests: Remove WP_Term::$filter property unset() within term tests.
Removes the `unset()` of the `WP_Term::$filter` property within the term tests.

Why?

Prior to the introduction of WP_Term, the term was added to the cache when its filter property was empty. To test the cache, the tests unset this property to trigger `wp_cache_add()` in `get_term()`. [34997] changed that behavior to trigger `wp_cache_add()` when the term was not found after `wp_cache_get()` (i.e. happened in `WP_Term::get_instance()`).

Unsetting the filter property is and was not needed. Prior to `WP_Term`, the condition was an empty value. With `WP_Term`, the filter property is no longer part of the conditional logic for caching.

Follow-up to [34997], [30954], [34035].

See #61890, #61530.
Built from https://develop.svn.wordpress.org/trunk@58919


git-svn-id: http://core.svn.wordpress.org/trunk@58315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-20 20:07:16 +00:00
Sergey Biryukov 1aa22ca3c6 Taxonomy: Correct the check for error messages in `wp-admin/edit-tag-form.php`.
Instead of checking for a specific message, e.g. “Item not updated”, the `$_REQUEST['error']` variable is now checked. This allows for custom messages added via the `term_updated_messages` filter to be considered an error when appropriate, and displayed with the correct CSS class.

This also brings consistency with a similar check in `wp-admin/edit-tags.php`.

Follow-up to [31823], [44663].

Props xipasduarte.
Fixes #61896.
Built from https://develop.svn.wordpress.org/trunk@58918


git-svn-id: http://core.svn.wordpress.org/trunk@58314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-20 17:50:16 +00:00
hellofromTonya fbf02475bc Media: Fix Media Library "Upload files" tab focus outline.
Adds a z-index to `.media-menu .media-menu-item:focus` to fix the "Upload files" tab's outline on the side next to the other tab.

Follow-up to [57553], [46363].

Props wildworks, antpb, huzaifaalmesbah, krupajnanda, nhrrob, oglekler, rajinsharwar, sabernhardt.
Fixes #60632.
Built from https://develop.svn.wordpress.org/trunk@58917


git-svn-id: http://core.svn.wordpress.org/trunk@58313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-20 16:57:14 +00:00
joedolson a88967db6e Media: Fix admin image cropping calculations.
The admin image editor crop function introduced rounding errors by using a scaled image to calculate values. Fix uses the image at 100% scale for calculations. Also avoid recalculating selection when the selection position is changed, and prevent incorrect values after scaling or restoration.

Previously committed in [58456] and reverted in [58571]. The revert was due to a misattributed test failure.

Props Jossnaz, johnillo, shailu25, rachelbaker, sudipatel007, joedolson, kevin940726 , andrewserong, hmbashar.
Fixes #32282.
Built from https://develop.svn.wordpress.org/trunk@58915


git-svn-id: http://core.svn.wordpress.org/trunk@58311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-19 20:47:17 +00:00
joedolson ce2b9f1fb2 Themes: Fix themes search event not firing on enter.
Attach the submit event to the parent search form in the installed and add new theme screen. Following [58405], the submit event was no longer attached to an object that was able to handle form submissions.

Props nithi22, nithins53, josklever, the-ank, debarghyabanerjee, sabernhardt, jeherve, hellofromtonya.
Fixes #61578.
Built from https://develop.svn.wordpress.org/trunk@58914


git-svn-id: http://core.svn.wordpress.org/trunk@58310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-19 19:19:17 +00:00
Sergey Biryukov 4b49b0d168 Site Health: Correct the check for disk space available to safely perform updates.
The `wp-content/upgrade` directory does not exist initially after installation, so the Site Health check could not determine the available disk space until the directory was subsequently created during an update.

By testing `WP_CONTENT_DIR` instead, the check can complete successfully.

This also brings consistency with similar checks in `_unzip_file_ziparchive()` and `_unzip_file_pclzip()`.

Follow-up to [55720], [56401].

Props wbdv, khokansardar, mi5t4n, SergeyBiryukov.
Fixes #61602.
Built from https://develop.svn.wordpress.org/trunk@58913


git-svn-id: http://core.svn.wordpress.org/trunk@58309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-19 15:21:14 +00:00
Sergey Biryukov 6c8056c2dd Tests: Bring some consistency to personal data email notification tests.
Includes:
* Adding a test for `wp_privacy_send_personal_data_export_email()` to verify the `user_request` post type.
* Reordering some pre-existing tests to check the request ID and post type first.

Follow-up to [43291], [43499], [44535].

Props garrett-eclipse, berubenic.
See #46560.
Built from https://develop.svn.wordpress.org/trunk@58912


git-svn-id: http://core.svn.wordpress.org/trunk@58308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-18 23:45:16 +00:00
Tammie Lister 2a6b396d8d Twenty Seventeen Fixes search block button styles not being the same.
The search block button was not the same back and front for background, text and font weight. This also reflects in editor-blocks stylesheet.

Props viralsampat, pamprn, sabernhardt, shailu25.
Fixes #61888.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-18 11:27:17 +00:00
Tammie Lister 72899185b7 Twenty Fifteen: Fixes hover effect being different in editors for link.
The link hover effect was different between the editor and front. As links are rarely focusable in the editor this patch does not set the outline color also.

Props pitamdey, sabernhardt, mi5t4n.
Fixes #61844.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-18 09:30:12 +00:00
Tammie Lister 14b463ac91 Twenty Twenty: Fixes image block caption alignment not being centered on mobile.
The image block caption was not being centered on mobile. This was set to start at 1000 pixels and wider. This might have been intended to prevent wrapping, but you can resolve this by unselecting alignment.

Props spanglishwebs, sabernhardt, sudipatel007, shailu25.
Fixes #50317.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-18 09:15:14 +00:00
Tammie Lister 4267b760ef Twenty Twenty: Fixes pullquote block font size not changing.
The pullquote block was not reflecting the size changes. This also accounts for letter spacing in the editor.

Props kmadhak, SergeyBiryukov, nidhidhandhukiya, harshvaishnav, sabernhardt, shailu25.
Fixes #55975.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-17 20:12:09 +00:00
Tammie Lister 8ea2151eec Twenty Sixteen: Fixes pullquote block typography not working.
The pullquote block was not reflecting the typography changes. This updated patch keeps the size and also fixes the line height.

Props pranitdugad, nidhidhandhukiya, jorbin, darshitrayaguru97, yurajsinj2211, ankit-k-gupta, poena, sabernhardt, shailu25.
Fixes #59919.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-17 20:06:10 +00:00
Sergey Biryukov e7e1e6549f Upgrade/Install: Remove the return value of `_wp_delete_all_temp_backups()`.
This function is only utilized as a `shutdown` action callback, so the return value is not used anywhere.

`wp_trigger_error()` is now used instead under the same conditions.

Follow-up to [55720], [56342].

Props johnbillion, amitraj2203, narenin.
Fixes #61116.
Built from https://develop.svn.wordpress.org/trunk@58906


git-svn-id: http://core.svn.wordpress.org/trunk@58302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-17 19:54:13 +00:00
Sergey Biryukov 8efc6e1807 Script Loader: Check if `error_reporting()` exists in `load-(scripts|styles).php`.
This avoids a fatal error on PHP 8 if `error_reporting()` is disabled in `php.ini`.

On systems with this function disabled, it's best to add a dummy function to the `wp-config.php` file, as there are multiple other calls in core or plugins.

However, as this call to the function is run prior to `wp-config.php` loading, it is now wrapped in a `function_exists()` check.

Follow-up to [50447].

Props gansbrest, sabernhardt, jrf, martin.krcho, SergeyBiryukov.
Fixes #61873.
Built from https://develop.svn.wordpress.org/trunk@58905


git-svn-id: http://core.svn.wordpress.org/trunk@58301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-16 14:29:15 +00:00
Mamaduka bfcd875946 Editor: Fix preloaded REST API paths
When providing an incorrect path to preload, the `rest_preload_api_request` will silently fail, and nothing will be preloaded.

* Fix typo for `wp_template_part` post type preload path for the Site Editor.
* Do not preload the `wp_block` post type for post editors. The endpoint doesn't support unbound queries, and the data is no longer needed during editor initialization.

Props kirasong, tyxla, mamaduka.
Fixes #61884.
Built from https://develop.svn.wordpress.org/trunk@58904


git-svn-id: http://core.svn.wordpress.org/trunk@58300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-16 06:23:17 +00:00
Aaron Jorbin af61bf819e Build/Test: update Props Bot to correct event type
The proper name is the plural `types`. This will cause the action to run only when necessary. Very Demure. Very mindful.

Ref: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#issue_comment

Props jeherve.
Fixes #61883

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


git-svn-id: http://core.svn.wordpress.org/trunk@58299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-15 17:48:16 +00:00
Sergey Biryukov c6324a7388 Script Loader: Remove redundant check in `wp_register_tinymce_scripts()`.
Since removing the build steps for a gzipped version of TinyMCE, the check whether gzip is supported on the server is superfluous. It may also result in the uncompressed files being used when the compressed files are available and could be used.

Follow-up to [44114], [44651].

Props MattyRob, hbhalodia.
Fixes #61862.
Built from https://develop.svn.wordpress.org/trunk@58902


git-svn-id: http://core.svn.wordpress.org/trunk@58298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-15 14:58:16 +00:00
Peter Wilson 1b400d5c47 Build/test tools: Remove prompt for trac ticket referenced with `Core-` prefix.
Prevents the GitHub bot from posting a comment on pull requests requesting a trac ticket link if the ticket description includes a link via the Core- prefix, eg Core-61865.

The WordPress/WordPress-Develop repository is configured to automatically convert the text to a trac ticket link.

Props martinkrcho, peterwilsoncc.
Fixes #61865.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-15 04:58:16 +00:00
Peter Wilson af6ec4afee Meta: Tidy up and update `.mailmap`.
Updates the name mappings to sort display names ascii-alphabetically and to ascribe commits to updated usernames.

Accounts without a seperate display name remain listed in the footer of the file.

Props dmsnell, jorbin.
See #61864.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-15 04:25:16 +00:00
dmsnell 8d8bd66d02 Meta: Add .mailmap to ascribe git commits to proper author.
From time to time a new commit will appear from an existing commit which has a different name or email address (or both) than an existing name or email address. This occurs because of changing names and changing emails and because of mistakes. Additionally, the `svg`-to-`git` process double-encodes names from `profiles.wordpress.org` causing corruption in names with non-US-ASCII characters.

This patch introduces a `.mailmap` file to alias committers so that:

 - All contributions for a given person are shown for that person.
 - Committers will be able to control or fix the display of their own name.

The `.mailmap` file is a standard `git` configuration.

Developed in https://github.com/wordpress/wordpress-develop/pull/7180
Discussed in https://core.trac.wordpress.org/ticket/61864

Fixes #61864.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-14 22:57:16 +00:00
dmsnell 5cd8048fc2 HTML API: Make "reset insertion mode appropriately" algorithm private.
The algorithm is described and referred to in the specification as
"reset the insertion mode appropriately." This patch renames it to
more accurately reflect the specification, and it turns the public
method private. As an internal algorithm from the HTML specification
it should not be open to extension.

Developed in https://github.com/wordpress/wordpress-develop/pull/7194
Discussed in https://core.trac.wordpress.org/ticket/61549

Follow-up to [28656].
Props jonsurrell.
See #61549.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-14 21:19:16 +00:00
dmsnell edd34df6ea HTML API: Use strict in_array comparison for checking URI attributes.
This patch modifies the URL-escaping code in the HTML API to rely on strict comparisons. This prevents accidental matching via type-coercion.

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

Follow-up to [58473].
Props jonsurrell.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-14 19:51:17 +00:00
hellofromTonya 713e76f16b Editor: Fix block custom CSS pseudo element selectors in global styles.
Fixes a regression introduced in [58241] where selectors with pseudo elements are wrapped within `:where()` causing malformed CSS and the CSS rule(s) not being applied.

When processing custom CSS for blocks, this changeset:

* Strips the pseudo-elements from the original nested selector, performs the required wrapping in `:root :where`, then re-appends the pseudo-element selector with its leading combinators if present.
* Removes empty CSS rules.

It includes the PHP changes.

Reference:
* PHP changes from [https://github.com/WordPress/gutenberg/pull/63980 Gutenberg PR 63980].

Follow-up to [58241], [56812], [55216].

Props aaronrobertshaw, wongjn, harlet7, dballari, ramonopoly, andrewserong, aristath, hellofromTonya.
Fixes #61769.
Built from https://develop.svn.wordpress.org/trunk@58896


git-svn-id: http://core.svn.wordpress.org/trunk@58292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-14 18:57:19 +00:00
Sergey Biryukov 87ec4292ae Network Admin: Improve button alignment in Right Now dashboard widget.
Follow-up to [16237].

Props sabernhardt.
Fixes #61869.
Built from https://develop.svn.wordpress.org/trunk@58895


git-svn-id: http://core.svn.wordpress.org/trunk@58291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-14 16:05:18 +00:00
Peter Wilson c1af99e7e6 Bulk/Quick Edit: Remove duplicate HTML IDs from post list tables.
Removes duplicate IDs on the post list admin pages affecting various list items, selects and checkboxes:

* JavaScript duplication of the inline editing HTML for bulk editing renames various IDs to include the prefix `bulk-edit-`,
* IDs in the Category Checkbox Walker make use of `wp_unique_prefixed_id()` to avoid duplicates, resulting in a numeric suffix, and,
* the post parent dropdown for the bulk editor is given a custom ID `bulk_edit_post_parent`.

Props peterwilsoncc, sergeybiryukov, azaozz, joedolson, siliconforks, zodiac1978, rcreators.
Fixes #61014.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-13 23:37:16 +00:00
dmsnell f957219299 HTML API: Only stop on full matches for requested tag name.
An optimization pass on the HTML API left a bug in the `matches()`
method, whereby it would falsely detect a tag name match if the
found tag were a lexical subset of the requested tag. This occurred
because of the use of `substr_compare()` without checking that the
outer lengths matched.

This patch resolves the bug by adding the length check.

Developed in https://github.com/wordpress/wordpress-develop/pull/7189
Discussed in https://core.trac.wordpress.org/ticket/61545

Follow-up to [58613].
Props dmsnell, westonruter.
See #61545.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-13 22:14:16 +00:00
dmsnell 9aaf4b144a HTML API: Remove unnecessary skips in tests for unsupported markup.
The HTML API allowed tests to be skipped for unsupported HTML, for example tags that had not yet been implemented. This provided stability to the test suite while primary support was being added.

In many places, the tags are now fully supported and the test skips can be removed.

Developed in https://github.com/wordpress/wordpress-develop/pull/7186
Discussed in https://core.trac.wordpress.org/ticket/61646

Props jonsurrell.
See #61646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-13 21:44:18 +00:00
hellofromTonya 30cd5e4ea0 Editor: Fix bumped specificity for layout styles in non-iframed editor.
Fixes a regression introduced in [58241] which inadvertently bumped the specificity in a non-iframed editor for `.editor-styles-wrapper .is-layout-flow > *` from (0,1,0) to (0,2,0). This fix restores theme.json spacing rules taking precedence over the implicit spacing rules in a non-iframed editor.

**The What**

When the block editor is not iframed (which can happen when Custom Fields are active, or blocks that use and older `apiVersion` are present), style rules are processed using post css to append the `.editor-styles-wrapper` class name. This has the effect of scoping the the style rules to ensure they don't affect the editor chrome or admin.

With [58241], one of the rules was changed to `.is-layout-flow > *`. In a iframed editor, the specificity of this rule is okay (0,1,0), but in a non-iframed editor it becomes `.editor-styles-wrapper .is-layout-flow > *`, a specificity of (0,2,0). Comparing this to before [58241], the same rule was `.editor-styles-wrapper :where(body .is-layout-flow) > *` (specificity 0,1,0). This is a regression in specificity that has caused some issues. Notably themes can no longer properly override the spacing for blocks using theme.json and have the results correctly shown in the non-iframed editor.

**The How**

This changeset modifies the selector to `:root :where(.is-layout-flow) > *` (still specificity 0,1,0). `transformStyles` handles 'root' selectors a little differently, it'll instead replace the `:root` part so it becomes `.editor-styles-wrapper where(.is-layout-flow) > *` (keeping the specificity at 0,1,0).

The other layout selector that this affects is the `:first-child` `:last-child` selectors that are responsible for resetting margin at the start and end of a block list. They traditionally have a 0,2,0 specificity so that they can override both the above rule and any rules in the theme.json. Those selectors are also maintained at 0,2,0 with this change, they become something like `:root :where(.is-layout-flow) > :first-child`.

**References:**
* PHP changes from [https://github.com/WordPress/gutenberg/pull/64076 Gutenberg PR 64076].

Follow-up to [58241], [58228], [55956], [54162].

Props talldanwp, aaronrobertshaw, andrewserong, markhowellsmead, ramonopoly, hellofromTonya.
Fixes #61829.
Built from https://develop.svn.wordpress.org/trunk@58890


git-svn-id: http://core.svn.wordpress.org/trunk@58286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-13 17:45:18 +00:00
Sergey Biryukov 6eebb7cd54 Coding Standards: Replace an empty `foreach` loop in `wp_replace_in_html_tags()`.
This aims to clarify the intention of the code and improve readability.

Follow-up to [33359].

Props jrf, TobiasBg, mi5t4n, dhruvang21, mayura8991, nadimcse, Presskopp, SergeyBiryukov.
Fixes #61860.
Built from https://develop.svn.wordpress.org/trunk@58889


git-svn-id: http://core.svn.wordpress.org/trunk@58285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-13 16:29:18 +00:00
Sergey Biryukov 0058fa9195 Coding Standards: Bring some consistency to setting up comment moderation links.
Follow-up to [7082], [7175], [9103], [10102], [11749], [12008], [12286], [32516].

Props kebbet.
See #61607.
Built from https://develop.svn.wordpress.org/trunk@58888


git-svn-id: http://core.svn.wordpress.org/trunk@58284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-12 21:28:13 +00:00
Tammie Lister cda3a2e2b3 Twenty Twelve: Fixes navigation block submenus being cut off.
The navigation block submenus were being cut off. This is the simpler method proposed in patches.

Props poena, sabernhardt.
Fixes #61672.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-12 15:19:16 +00:00
Tammie Lister 95f6808e03 Twenty Seventeen: Fixes Pullquote block text color not changing on front.
The Pullquote block text color was not changing on the front. This overrides the inlined styles.

Props iamjaydip, laurelfulford, sabernhardt.
Fixes #46080.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-12 13:44:15 +00:00
Tammie Lister 4f8f6e9fa2 Twenty Twelve: Fixes Button block outline style having wrong text color on front.
The Button block has a different text color on the front to the editor when you apply text color. This resolves it without changing other styles.

Props pitamdey, ugyensupport, sabernhardt.
Fixes #61846.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-12 10:56:16 +00:00
Peter Wilson 8fa1b1d696 Site Health: Check if directories exist before checking size.
Prevents the Site Health Debug tab from stalling when reporting directory sizes if the directory does not exist.

Props clorith, aristath, narenin, kowsar89, hellofromTonya, ironprogrammer, shailu25.
Fixes #61638.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-12 04:54:15 +00:00
Sergey Biryukov a596bd6848 Docs: Switch canonical location for the `comment_row_actions` filter.
This aims to bring consistency with the other `*_row_actions` filters.

Follow-up to [6705], [8217], [9103], [15491], [26138], [27669].

See #61608.
Built from https://develop.svn.wordpress.org/trunk@58883


git-svn-id: http://core.svn.wordpress.org/trunk@58279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-11 21:10:13 +00:00
Tammie Lister c057097377 Twenty Twelve: Fixes Code block font family difference in editors.
The Code block font family was different in the front-end and the editor. This resolves the overruling in the iframe editor.

Props pitamdey, sabernhardt.
Fixes #61808.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-11 14:26:17 +00:00
Tammie Lister 3b734c3e0b Twenty Nineteen: Fixes translatable strings with HTML code not appearing.
Only the translatable part not HTML, should appear for translators to avoid issues. This resolves one string that was not appearing. This only fixed for one theme although discussion on the ticket was for multiples. Other tickets should be open for those if desireable.

Props Presskopp, SergeyBiryukov, pratikkry, pento, mukesh27, laurelfulford, kjellr, desrosj, sabernhardt.
Fixes #45473.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-11 09:45:17 +00:00
Peter Wilson d09e94165e External Libraries: Update the Underscore.js library to version 1.13.7.
This updates the Underscore library from version 1.13.6 to 1.13.7. This is a minor bug fix release.

The full list of changes can be found in the Underscore.js change log: https://underscorejs.org/#changelog.

Props hbhalodia, aristath, desrosj, mcrisp1972.
Fixes #61836.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-10 23:57:16 +00:00
Sergey Biryukov 8a164c4d9c Administration: Replace contracted verb forms for better consistency.
Follow-up to [14951], [37221], [52979], [52978], [55977].

Props kebbet, sabernhardt.
Fixes #58639.
Built from https://develop.svn.wordpress.org/trunk@58879


git-svn-id: http://core.svn.wordpress.org/trunk@58275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-10 23:02:06 +00:00
Peter Wilson bf103e6621 Code Quality: Clarify variable names in dependency classes.
Renames several variables in the `WP_Scripts` and `WP_Styles` classes to clarify their purpose for developers reading the code.

Props peterwilsoncc, sergeybiryukov.
See #61607.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-10 23:00:14 +00:00
dmsnell 98e51518b3 HTML API: Remove completed TODO comments.
This patch removes TODO comments indicating the need to verify certain behaviors and algorithms. Those verifications have taken place and the comments are no longer needed.

Developed in https://github.com/wordpress/wordpress-develop/pull/7174
Discussed in https://core.trac.wordpress.org/ticket/61646

Follow-up to [58867], [58870].

Props jonsurrell.
See #64646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-10 05:00:14 +00:00
Felix Arntz 79e47b14ab Build/Test Tools: Avoid using `wp_delete_user()` in PHPUnit tests unless explicitly acknowledging or ignoring Multisite.
`wp_delete_user()` does not actually delete the entire user when using WordPress Multisite. Therefore tests should typically use the test helper method to fully delete the user, unless explicitly ignoring Multisite or testing the `wp_delete_user()` function while taking Multisite behavior into account.

Fixes #61851.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-09 18:31:13 +00:00
Felix Arntz 3fdbfb0f4a Comments: Add optional `$context` parameter to `get_edit_comment_link()` to get the URL without HTML entities.
This brings the function in line with the similar `get_edit_post_link()` parameter. The 'get_edit_comment_link' filter now additionally receives the `$comment_id` and `$context` as parameters.

Additionally, as a minor enhancement, the capability check is now more defensive, as it will no longer cause an error if the given comment ID is invalid.

As part of the changeset, comprehensive test coverage for the `get_edit_comment_link()` including the new behavior is added.

Props deepakrohilla.
Fixes #61727.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-09 18:01:19 +00:00
Sergey Biryukov ddab80be2c Docs: Remove unsupported values in `plugins_api()` DocBlocks.
The `group` field and the `hot_categories` action were never actually implemented on the WordPress.org side.

Follow-up to [34596], [meta3227].

Props lopo, milana_cap.
See #55645.
Built from https://develop.svn.wordpress.org/trunk@58873


git-svn-id: http://core.svn.wordpress.org/trunk@58269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-09 00:18:16 +00:00
desrosj 32bf860db4 External Libraries: Update the Backbone.js library to version `1.6.0`.
This updates the `backbone` library from version `1.5.0` to `1.6.0`. This is a minor bug fix release.

The full list of changes can be found in the Backbone.js change log: https://backbonejs.org/#changelog.

Props manooweb mardroid.
Fixes #60512.
Built from https://develop.svn.wordpress.org/trunk@58872


git-svn-id: http://core.svn.wordpress.org/trunk@58268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-08 19:37:19 +00:00
dmsnell c834d20762 HTML API: Test and fix SVG script handling.
When support was added for foreign content, an ambiguity in the HTML specification led to code that followed the wrong path when encountering a self-closing SCRIPT element in the SVG namespace. Further, a fallthrough was discovered during manual testing.

This patch adds a new test to assert the proper behaviors and fixes these issues. In the case of the SCRIPT element, the outcome was the same with the wrong code path, making the defect benign. In the case of the fallthrough, the wrong behavior would occur.

The updates in this patch also resolves a todo relating to the spec ambiguity.

Developed in https://github.com/wordpress/wordpress-develop/pull/7164
Discussed in https://core.trac.wordpress.org/ticket/61576

Follow-up to [58868].

Props: dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-08 17:04:19 +00:00
dmsnell 7611ec9415 HTML API: `expect_closer()` should report false for self-closing foreign elements.
Previously, `WP_HTML_Processor::expects_closer()` would report `true` for self-closing foreign elements when called without supplying a node in question, but it should have been reporting `true` just as it does for HTML elements.

This patch adds a test case demonstrating the issue and a bugfix.

The `html5lib` test runner was relying on the incorrect behavior, accidentally working. This is also corrected and the `html5lib` test now relies on the correct behavior of `expects_closer()`.

Developed in https://github.com/wordpress/wordpress-develop/pull/7162
Discussed in https://core.trac.wordpress.org/ticket/61576

Follow-up to [58868].

Props: dmsnell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-08 16:15:20 +00:00
dmsnell ed0e5cff79 HTML API: Add support for SVG and MathML (Foreign content) (remove file)
As part of work to add more spec support to the HTML API, this patch adds support for SVG and MathML elements, or more generally, "foreign content."

The rules in foreign content are a mix of XML and HTML parsing rules and introduce additional complexity into the processor, but is important in order to avoid getting lost when inside these elements.

This patch follows the first by deleting the empty files, which were mistakenly left in during the initial merge.

Developed in https://github.com/wordpress/wordpress-develop/pull/6006
Discussed in https://core.trac.wordpress.org/ticket/61576

Follow-up to [58867].

Props: dmsnell, jonsurrell, westonruter.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-08 07:33:19 +00:00
dmsnell 1ffe7a456c HTML API: Add support for SVG and MathML (Foreign content)
As part of work to add more spec support to the HTML API, this patch adds
support for SVG and MathML elements, or more generally, "foreign content."

The rules in foreign content are a mix of XML and HTML parsing rules and
introduce additional complexity into the processor, but is important in
order to avoid getting lost when inside these elements.

Developed in https://github.com/wordpress/wordpress-develop/pull/6006
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell, westonruter.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-08 07:25:15 +00:00
dmsnell f200230d18 HTML API: Ensure that `get_modifiable_text()` reads enqueued updates.
When `set_modifiable_text()` was added to the Tag Processor, it was considered that the same information could be queried after setting its value and before proceeding to the next token, but unfortunately overlooked that if the starting modifiable text length was zero, then the read in `get_modifiable_text()` would ignore enqueued updates.

In this patch, `get_modifiable_text()` will read any enqueued values before reading from the input HTML document to ensure consistency.

Follow-up to [58829].
Props dmsnell, jonsurrell, ramonopoly.
Fixes #61617.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-08 04:26:13 +00:00
Sergey Biryukov 0fca569339 Docs: Correct alignment for `rest_insert_attachment` action DocBlock.
Follow-up to [39348].

Props krupalpanchal.
See #61608.
Built from https://develop.svn.wordpress.org/trunk@58865


git-svn-id: http://core.svn.wordpress.org/trunk@58261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-08 02:27:18 +00:00
hellofromTonya 25cd14c509 Docs: Remove bugfix since annotations from WP_Theme_JSON::get_block_nodes().
Removes the `@since` bugfix annotations from `WP_Theme_JSON::get_block_nodes()` docblock. Bugfixes are not annotated in docblocks.

Follow-up to [58856].
See #61704.
Built from https://develop.svn.wordpress.org/trunk@58864


git-svn-id: http://core.svn.wordpress.org/trunk@58260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-07 19:58:17 +00:00
desrosj cb0f56f131 External Libraries: Update the `whatwg-fetch` polyfill library.
This updates the `whatwg-fetch` library from version `3.6.17` to `3.6.20`, the latest current version.

This library is included and registered within WordPress as the `wp-polyfill-fetch` script but is no longer used by WordPress itself. Updates are provided as a courtesy, and all projects using this polyfill should reevaluate usage.

Props manooweb.
Fixes #60514.
Built from https://develop.svn.wordpress.org/trunk@58860


git-svn-id: http://core.svn.wordpress.org/trunk@58256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-07 15:52:22 +00:00
dmsnell c4cd3c1c4b HTML API: Use full parser in html5lib tests.
Previously the `html5lib` tests have only run in the fragment parser mode,
assuming IN BODY context. This limited the number of tests which could run
and was a result of the HTML Processor only supporting the IN BODY fragment
parser. In [58836], however, a full parser was added to the HTML Processor.

In this patch the full parser is utilized in order to run more of the
previously-skipped tests, asserting more behaviors in the HTML parsing.

Developed in https://github.com/wordpress/wordpress-develop/pull/7117
Discussed in https://core.trac.wordpress.org/ticket/61646

Props: dmsnell, jonsurrell.
See #61646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-06 22:07:19 +00:00
dmsnell ac4ebc8d07 HTML API: Truncated funky comments should cause the Tag Processor to pause.
A state change was missing in the Tag Processor when the input is too short to
find a comment closer after an opened funky comment. This patch fixes a issue
where `</#` does not correctly report incomplete input, but `</# ` does.

Developed in https://github.com/wordpress/wordpress-develop/pull/7146
Discussed in https://core.trac.wordpress.org/ticket/61831

Props: jonsurrell.
Fixes #61831.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-06 20:43:18 +00:00
Sergey Biryukov 1396f6e30c Site Health: Clarify the description for `max_file_uploads` in Site Health Info.
Follow-up to [48535].

Props iflairwebtechnologies, hbhalodia, mukesh27, SergeyBiryukov.
Fixes #61814.
Built from https://develop.svn.wordpress.org/trunk@58857


git-svn-id: http://core.svn.wordpress.org/trunk@58253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-06 13:22:11 +00:00
talldanwp f2bf0373a5 Theme JSON: Ensure root selector (body) is not wrapped in :root :where().
Pre-WordPress 6.6, the `body` selector was used for styles associated with the body.

In 6.6, this was mistakenly changed to `:root :where(body)`, an increase in specificity, causing some issues for themes.

This change reverts the specificity increase, styles again use the `body` selector.

Syncs PHP changes from https://github.com/WordPress/gutenberg/pull/63726.

Props talldanwp, andrewserong, aaronrobertshaw, mukesh27, hellofromtonya.
Fixes #61704.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-06 08:26:12 +00:00
dmsnell dc84e3d2c2 WP_Debug_Data: Extract `wp-constants` data into separate method.
This is the part two in a larger modularization of the data in `WP_Debug_Data`.
Previously this was a single massive method drawing in debug data from various
groups of related data, where the groups were independent from each other.

This patch separates the second of twelve groups, the `wp-constants` info,
into a separate method focused on that data.

This work precedes changes to make the `WP_Debug_Data` class more extensible
for better use by plugin and theme code.

Developed in https://github.com/wordpress/wordpress-develop/pull/7106
Discussed in https://core.trac.wordpress.org/ticket/61648

Props: apermo, costdev, dmsnell.
See #61648.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-05 21:39:11 +00:00
Sergey Biryukov 1a2b5794da Menus: Check if taxonomy term exists in `wp_update_nav_menu_item()`.
When inserting a term from a non-existing taxonomy as a nav item, the `post_title` property should be empty, and the function should not throw a fatal error for `wp_specialchars_decode()`.

Includes bringing some consistency to similar checks for post types and post type archives in the same code fragment.

Follow-up to [14283], [14450], [35382], [36095].

Props dd32, narenin, mukesh27, SergeyBiryukov.
Fixes #61799.
Built from https://develop.svn.wordpress.org/trunk@58854


git-svn-id: http://core.svn.wordpress.org/trunk@58250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-05 19:00:19 +00:00
Tammie Lister ae993cf8e2 Twenty Twenty-One: Fixes float clearing elements being visible in Row and Grid blocks.
The grid layout looks different between front and back end due to the float clearing elements being visible in Row and Grid blocks. This moves the hack rather than deletes it.

Props up1512001, sabernhardt, poena.
Fixes #61611.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-05 10:09:15 +00:00
Tammie Lister c0d665f64e Twenty Sixteen: Fixes Code block not showing same line-height and padding on front and in editor.
The Code block had a difference in line-height and padding in the editor and front end. This does not fix font-family which has another ticket.

Props viralsampat, sabernhardt.
Fixes #61700.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-05 09:51:11 +00:00
Tammie Lister 76a44b13d4 Twenty Nineteen: Fixes Button block not changing appearance settings.
The Button block isn't reflecting appearance settings. This fix keeps the default as font-weight bold but also adds support for other weights.

Props pranitdugad, pitamdey, sabernhardt.
Fixes #61437.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-05 08:57:15 +00:00
talldanwp 2468ef9f8c Block Styles: Fix ordering of stylesheets when a style variation is applied.
Adjusts the dependency order to ensure stylesheets are output in the correct order.

Syncs the PHP changes from https://github.com/WordPress/gutenberg/pull/63918.

Props talldanwp, aaronrobertshaw, andrewserong, aristath, mukesh27, ramonopoly, ytfeldrawkcab.
Fixes #61748.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-05 06:41:14 +00:00
noisysocks 3a703f86cd Media: Automatically convert HEIC images to JPEG
Automatically create a JPEG version of uploaded HEIC images if the server has
a version of Imagick that supports HEIC. Conversion is done silently through
the existing `WP_Image_Editor` infrastructure that creates multiple sizes of
uploaded images.

This allows users to view HEIC images in WP Admin and use them in their posts
and pages regardless of whether their browser supports HEIC. Browser support
for HEIC is relatively low (only Safari) while the occurrence of HEIC images is
relatively common. The original HEIC image can be downloaded via a link on
the attachment page.

Props adamsilverstein, noisysocks, swissspidy, spacedmonkey, peterwilsoncc.
Fixes #53645.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-05 04:13:15 +00:00
Peter Wilson 066d83f670 General: Removing static from `wp_get_wp_version()`.
Removes the static storing the version number in `wp_get_wp_version()` to ensure the version number is reported correctly after a WordPress upgrade is completed.

Reverts [58827].

Props costdev, SergeyBiryukov, Cybr.
See #61782.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-04 22:09:18 +00:00
Sergey Biryukov f2569d2e2d Site Health: Display raw value for `max_file_uploads` on Site Health Info screen.
This resolves a fatal error if `strict_types` PHP setting is enabled:
{{{
Argument #1 ($num) must be of type float, string given
}}}

Since the goal of the Site Health Info screen is to display raw values where possible, the `number_format()` call here does not seem to provide any benefit.

Props krishneup, sabernhardt, audrasjb, SergeyBiryukov.
Fixes #60364.
Built from https://develop.svn.wordpress.org/trunk@58847


git-svn-id: http://core.svn.wordpress.org/trunk@58243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-04 22:03:17 +00:00
Sergey Biryukov 822782a917 Docs: Correct documentation for `the_password_form` hook.
This replaces an outdated note about the 20 characters limit on the password field in the WordPress database schema.

The `post_password` column was increased to 255 characters in WordPress 4.7.

Follow-up to [27676], [38590].

Props debarghyabanerjee, peterwilsoncc, dd32, mukesh27.
Fixes #61703.
Built from https://develop.svn.wordpress.org/trunk@58846


git-svn-id: http://core.svn.wordpress.org/trunk@58242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-03 18:32:14 +00:00
dmsnell 8d059b9fe2 HTML API: Fix an infinite loop in certain unclosed SCRIPT tags.
When the Tag Processor (or HTML Processor) attempts to parse certain
incomplete script tags, the parser enters an infinite loop and will
hang indefinitely. The conditions to reach this situation are:

- Input HTML ends with an open script tag.
- The final character of input is `-` or `<`.

The infinite loop was caused by the parser-advancing increment not being
called when two `||` OR conditions short-circuited. If the first
condition was true, the `$at++` code was never reached.

This path resolves the issue.

Developed in https://github.com/wordpress/wordpress-develop/pull/7128
Discussed in https://core.trac.wordpress.org/ticket/61810

Follow-up to [55203].

Props: dmsnell, jonsurrell.
Fixes #61810.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-02 23:48:14 +00:00
dmsnell 7a86a5a42f HTML API: Indicate when WordPress rejects attribute updates.
When setting an an attribute value in the HTML API, WordPress may reject
an update based on rules in `kses`. In these cases, the return value from
an escaping function will be an empty string, and the HTML API should
reject the update. Unfortunately, it currently reports that it updates the
attribute but sets an empty string value, which is misleading.

In this patch, the HTML API will refuse the attribute update and return
false to indicate as much when WordPress rejects the updates.

Developed in https://github.com/wordpress/wordpress-develop/pull/7114
Discussed in https://core.trac.wordpress.org/ticket/61719

Follow-up to [58472].

Props: amitraj2203, dmsnell, mukesh27.
Fixes #61719.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-02 22:59:12 +00:00
Peter Wilson 6a559b739b General: Use clean WordPress version in `is_wp_version_compatible()`.
Update `is_wp_version_compatible()` to use `wp_get_wp_version()` introduced in [58813] to ensure the value of `$wp_version` has not been modified by a theme or plugin.

Props costdev, mukesh27, Cybr, sergeybiryukov.
Fixes #61781.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-02 22:38:15 +00:00
Sergey Biryukov 99fc7666ac Docs: Improve the wording for `cron_reschedule_event_error` action description.
Follow-up to [54258].

Props NekoJonez, audrasjb.
See #61608.
Built from https://develop.svn.wordpress.org/trunk@58842


git-svn-id: http://core.svn.wordpress.org/trunk@58238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-02 19:40:16 +00:00
dmsnell 90a66c7ad1 HTML API: Add support for IN SELECT IN TABLE parsing.
As part of work to add more spec support to the HTML API, this patch adds
support for the IN SELECT IN TABLE insertion mode. This small section of the
spec handles rules for the `<select>` element and its children when found
inside of a `<table>`.

Developed in https://github.com/wordpress/wordpress-develop/pull/7044
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-01 22:53:16 +00:00
dmsnell 40114e8ed5 HTML API: Add support for IN CAPTION parsing.
As part of work to add more spec support to the HTML API, this patch adds
support for the IN CAPTION insertion mode. This small section of the
spec handles rules for the `<caption>` element.

Developed in https://github.com/wordpress/wordpress-develop/pull/7041
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-01 22:36:13 +00:00
dmsnell 5cfd2dee00 HTML API: Add support for IN COLUMN GROUP parsing.
As part of work to add more spec support to the HTML API, this patch adds
support for the IN COLUMN GROUP insertion mode. This small section of the
spec handles rules for the `<colgroup>` element.

Developed in https://github.com/wordpress/wordpress-develop/pull/7042
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-01 22:06:12 +00:00
Sergey Biryukov 35af67f47d Docs: Correct some typos in a comment in `wp_salt()`.
Follow-up to [58837].

Props kebbet.
Fixes #59871.
Built from https://develop.svn.wordpress.org/trunk@58838


git-svn-id: http://core.svn.wordpress.org/trunk@58234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-08-01 20:32:19 +00:00
Peter Wilson 61fa836ce5 Options, Meta APIs: Prime salts when stored in database.
For salts generated and stored in the database, use `wp_prime_site_option_caches()` within `wp_salt()` to prime the options in a single database query, down from up to nine database queries.

The options are primed when the corresponding constant is either undefined or uses the default string `put your unique phrase here`.

Props joemcgill, spacedmonkey, peterwilsoncc.
Fixes #59871.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-31 22:58:14 +00:00
dmsnell af6e4904af HTML API: Introduce full parsing mode in HTML Processor.
The HTML Processor has only supported a specific kind of parsing mode
called _the fragment parsing mode_, where it behaves in the same way
that `node.innerHTML = html` does in the DOM. This mode assumes a
context node and doesn't support parsing an entire document.

As part of work to add more spec support to the HTML API, this patch
introduces a full parsing mode, which can parse a full HTML document
from start to end, including the doctype declaration and head tags.

Developed in https://github.com/wordpress/wordpress-develop/pull/6977
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-31 16:56:15 +00:00
Sergey Biryukov 2602d78021 Bundled Themes: Update schema version in style variation files.
This ensures that settings and styles are properly handled by code editors that support schema.

Reference: [https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-v2/#json-schema Theme.json Version 2 Reference: JSON Schema].

Follow-up to [58403].

Props poena, umeshsinghin.
Fixes #61789.
Built from https://develop.svn.wordpress.org/trunk@58835


git-svn-id: http://core.svn.wordpress.org/trunk@58231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-31 14:05:16 +00:00
ramonopoly 38fdd7bb3a Background: add background attachment support to theme.json styles
Introduces the ability to specify a value for `background.backgroundAttachment` in theme.json styles.

The theme.json value determines the CSS value for the `background-attachment` property.

This feature was introduced into the Gutenberg plugin in version 18.9.

Props andrewserong, mukesh27, noisysocks, ramonopoly.

Fixes #61720


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


git-svn-id: http://core.svn.wordpress.org/trunk@58230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-31 02:41:16 +00:00
dmsnell f483d6dc4e HTML API: Add TEMPLATE and related support in HTML Processor.
As part of work to add more spec support to the HTML API, this patch adds
support for the IN TEMPLATE and IN HEAD insertion modes. These changes are
primarily about adding support for TEMPLATE elements in the HTML Processor,
but include support for other tags commonly found in the document head, such
as LINK, META, SCRIPT, STYLE, and TITLE.

Developed in https://github.com/wordpress/wordpress-develop/pull/7046
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell, westonruter.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-30 18:46:35 +00:00
Sergey Biryukov c78101d432 Site Health: Improve the wording for PHP version check.
This aims to make the message more accurate by referring to the version of PHP currently recommended by WordPress, not the current version of PHP.

Follow-up to [44986], [46267], [47254].

Props swb1192, psykro, swissspidy, joemcgill, mukesh27, aristath.
See #61623.
Built from https://develop.svn.wordpress.org/trunk@58832


git-svn-id: http://core.svn.wordpress.org/trunk@58228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-30 12:25:16 +00:00
dmsnell 63c7122ed0 REST API, Meta: Store updates in database when they are equal to the defaults.
This patch fixes an oversight from when default metadata values were introduced
in #43941 in WordPress 5.5: metadata updates should persist in the database
even if they match the registered default value (because the default values 
can change over time).

Previously, the REST API code was comparing updated values against the value
returned by the default-aware `get_metadata()` method. This meant that if no
value existed in the database, and the default value was supplied to the update,
WordPress would think that the updated value was already persisted and skip
the database call.

Now, the `get_metadata_raw()` method is called for comparing whether or not
a database update is required, fixing the bug.

In this patch both issues are resolved.

Developed in https://github.com/wordpress/wordpress-develop/pull/6782
Discussed in https://core.trac.wordpress.org/ticket/55600

Follow-up to [48402].

Props: dmsnell, kraftner, ramon-fincken.
Fixes #55600.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-29 18:49:14 +00:00
dmsnell faacd44911 WP_Debug_Data: Extract `wp-filesystem` data into separate method.
This is the first part in a larger modularization of the data in `WP_Debug_Data`.
Previously this was a single massive method drawing in debug data from various
groups of related data, where the groups were independent from each other.

This patch separates the first of twelve groups, the `wp-filesystem` info,
into a separate method focused on that data.

This work precedes changes to make the `WP_Debug_Data` class more extensible
for better use by plugin and theme code.

Developed in https://github.com/wordpress/wordpress-develop/pull/7065
Discussed in https://core.trac.wordpress.org/ticket/61648

Props: afragen, apermo, costdev, dmsnell.
See #61648.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-29 18:22:12 +00:00
dmsnell aaa6658da9 HTML API: Add set_modifiable_text() for replacing text nodes.
This patch introduces a new method, `set_modifiable_text()` to the
Tag Processor, which makes it possible and safe to replace text nodes
within an HTML document, performing the appropriate escaping.

This method can be used in conjunction with other code to modify the
text content of a document, and can be used for transforming HTML
in a streaming fashion.

Developed in https://github.com/wordpress/wordpress-develop/pull/7007
Discussed in https://core.trac.wordpress.org/ticket/61617

Props: dmsnell, gziolo, zieladam.
Fixes #61617.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-29 17:59:12 +00:00
dmsnell d8ab99f84b HTML API: Close all elements at the end of a document.
When the model of breadcrumb generation in the HTML Processor and node
traversal was simplified, the change introduced a bug whereby unclosed
nodes at the end of a document would remain unvisited and unclosed.

In this patch, a fix is applied to ensure that all open elements close
while traversing a document. A couple of minor documentation typos are
fixed in the patch as well.

Developed in https://github.com/wordpress/wordpress-develop/pull/7085
Discussed in https://core.trac.wordpress.org/ticket/61576

Follow-up to [58713].

Props: dmsnell, gziolo, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-29 17:39:17 +00:00
Sergey Biryukov 12991d53a4 General: Memoize the return value in `wp_get_wp_version()`.
This aims to optimize performance by saving the return value to a static variable, so that the `version.php` file is not unnecessarily required on each function call.

Follow-up to [58813].

Props Cybr, debarghyabanerjee, mukesh27.
Fixes #61782. See #61627.
Built from https://develop.svn.wordpress.org/trunk@58827


git-svn-id: http://core.svn.wordpress.org/trunk@58223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-29 15:02:17 +00:00
Sergey Biryukov eb33b8b4f7 General: Move `wp_get_wp_version()` to a more appropriate place.
This places the function in a more predictable location, next to the `is_wp_version_compatible()` and `is_php_version_compatible()` functions.

Follow-up to [58813].

See #61627.
Built from https://develop.svn.wordpress.org/trunk@58826


git-svn-id: http://core.svn.wordpress.org/trunk@58222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-29 14:52:19 +00:00
luisherranz 77f5a025b2 Interactivity API: Allow server derived state to appear in non-final position
In some cases, derived state returns an associative array. Directives may wish to continue to access properties of the associative array, when using the syntax `state.arrayReturnedByClosure.property`. This patch continues evaluating the path after the associative array has been returned by the Closure.

Props jonsurrell, luisherranz.

Fixes #61741.
Built from https://develop.svn.wordpress.org/trunk@58825


git-svn-id: http://core.svn.wordpress.org/trunk@58221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-29 11:10:23 +00:00
Tammie Lister 2fecc77a68 Twenty Twenty: Fixes Table font size when custom showing on front.
The Table block was not reflecting the custom font size on the front. This solution now brings custom font sizes in for front the same as back in the editor.

Props umesh84, SergeyBiryukov, sabernhardt, shailu25.
Fixes #56157.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-29 10:10:16 +00:00
Tammie Lister 8c22cdcc5f Twenty Seventeen: Fixes floated images having an extra space when the first image.
The first image when floated in content had extra spacing. This was only for the first image in testing so the solution focuses on that.

Props kjellr, sabernhardt, hmbashar, shailu25.
Fixes #46785.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-29 09:32:13 +00:00
Peter Wilson 062fb886f3 Users: Always use HTTPS URLs for Gravatar links.
Modifies gravatar image URLs to always use the HTTPS version from secure.gravatar.com. 

Gravatar now redirects HTTP image requests to their HTTPS equivalent, resulting in redirects for sites running over an HTTP connection (`is_ssl() === false`). Since the introduction of HTTP/2 the use of sub-domains for different hashes ([1-3].gravatar.com) now represents a performance hinderance rather than improvement.

The scheme passed to `get_avatar_data()` is now ignored for the generation of Gravatar URLs but the setting retained to avoid introducing bugs for sites using either local avatars or third party providers.

Props neoxx, SergeyBiryukov, sippis, peterwilsoncc, mukesh27, costdev, dd32.
Fixes #37454.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-29 01:59:18 +00:00
Sergey Biryukov 05e35e900e Feeds: Introduce `feed_links_args` and `feed_links_extra_args` filters.
This allows for more flexibility in modifying how feed links are displayed by the `feed_links()` and `feed_links_extra()` functions, including, for example, a way to change the `&raquo;` separator to something else.

Follow-up to [10377], [33838], [33839], [53125], [54161].

Props topdownjimmy, tw2113, williampatton.
Fixes #43225.
Built from https://develop.svn.wordpress.org/trunk@58821


git-svn-id: http://core.svn.wordpress.org/trunk@58217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-28 18:27:17 +00:00
Peter Wilson 8e77c7711e Application Passwords: Open documentation link in same window.
Removes the `target` to to documentation for [https://developer.wordpress.org/apis/wp-config-php/#wp-environment-type setting the environment type] for applications passwords so the tabs open in the same window.

This follows [58137] which added a confirmation prompt for users navigating away from the profile edit screen if they have changed data without saving it.

Props sabernhardt, joedolson.
Fixes #60100.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-27 23:06:17 +00:00
Tammie Lister 3bab2c9131 Twenty Twenty: Calendar and Table blocks do not apply custom font size.
This fixes adding a custom font size to a Calendar and Table block. This was only an issue for custom font size entering.

Props nidhidhandhukiya, yurajsinj2211, ankit-k-gupta, anveshika, sabernhardt, darshitrajyaguru97, shailu25, umesh84, SergeyBiryukov.
Fixes #59996, #56157.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-27 16:43:15 +00:00
Tammie Lister 9c5b1391d7 Twenty Twenty-Three: Fixes unnecessary borders for links images in Whisper variation.
This fixes the Whisper variation having borders for links images. Other styles did not have this.

Props colorful-tones, sabernhardt.
Fixes #57368.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-27 12:34:15 +00:00
Tammie Lister 30cf05b738 Twenty Twenty: Adds Plain Style into Quote block.
Plan style was missing for the Quote block. This brings it in as should have been originally.

Props kajalgohel, devtanbir, costdev, sabernhardt.
Fixes #56011.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-27 10:14:14 +00:00
Tammie Lister 40bb20fd83 Multiple themes: Fixes Code block not adjusting to font size changes.
This resolves the Code block not changing when the font sizes are switched in Twenty Eleven and Twenty Twelve. The solution is the same as used for other code block adjustments for font sizes.

Props viralsampat, sabernhardt.
Fixes #61753.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-27 09:37:10 +00:00
Tammie Lister 05179b4791 Twenty Thirteen: Fixes Code block not adjusting to font size changes.
This resolves the Code block not changing when the font sizes are switched. This theme uses a 14 px size for both and this uses inherit when nested inside pre tag.

Props viralsampat, sabernhardt.
Fixes #61697.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-27 09:24:15 +00:00
Sergey Biryukov 7d8913c256 Docs: Clarify the description for `wp_strip_all_tags()`.
Follow-up to [11929], [27042].

Props coffee2code, krupalpanchal, mukesh27.
Fixes #61759.
Built from https://develop.svn.wordpress.org/trunk@58814


git-svn-id: http://core.svn.wordpress.org/trunk@58210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-27 07:52:14 +00:00
Peter Wilson dd21bf5f22 General: Introduce `wp_get_wp_version()` to get unmodified version.
Introduces `wp_get_wp_version()` to get an unmodified value of `$wp_version` from `wp-includes/version.php`. Some plugins modify the global in an attempt to improve security through obscurity. This practice can cause errors in WordPress so the ability to get an unmodified version is needed.

Replaces instances within the code base in which `version.php` was required in order to get an unmodified value. `script-loader.php` is intentionally excluded from the replacements as the function is not always available to the file.

Props debarghyabanerjee, afragen, costdev.
See #61627.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-27 00:27:16 +00:00
Sergey Biryukov ee3beccbd1 General: Cast `$max_depth` and `$depth` to an integer in the `Walker` class.
This ensures that the arguments are correctly interpreted when passed as a query string, i.e. when `wp_parse_args()` is involved. For example, `wp_list_pages( 'depth=0' )` should display a list of all pages to the maximum depth.

Follow-up to [57848].

Props freibergergarcia, peterwilsoncc, ahortin.
Fixes #61749.
Built from https://develop.svn.wordpress.org/trunk@58812


git-svn-id: http://core.svn.wordpress.org/trunk@58208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-26 07:56:13 +00:00
Peter Wilson 213355eb80 Options, Meta APIs: Prevent Single Site installs using network notoptions cache.
Modifies the caching of `notoptions` in `delete_network_option()` to ensure that the network cache is bypassed on single site installs.

On single site installs the incorrect caching was causing the `notoptions` cache to remain populated once a deleted option was subsequently added or updated.

Follow up to [58782].

Props bjorsch, pbearne.
Fixes #61730.
See #61484.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-25 23:04:12 +00:00
Peter Wilson db0c2dacbf General: Update English Gravatar links.
Replace links to en.gravatar.com with links to gravatar.com as the english site now uses the base domain. This avoids an unnecessary redirect for english language sites.

The links remain translatable for non-english versions of WordPress.

Props narenin, knutsp.
Fixes #61424.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-25 22:40:09 +00:00
Sergey Biryukov bb26471543 Comments: Only type cast a scalar `$comment_id` in `get_comment_author_link()`.
This aims to resolve a fatal error when the incoming `$comment_id` is an instance of `WP_Comment` (or any object) without a `comment_ID` property defined, or if it's empty:
{{{
Object of class WP_Comment could not be converted to string
}}}

This commit mirrors the changes previously made for a similar code fragment in `get_comment_author()`.

Includes:
* Unit tests to demonstrate the fatal error and validate the fix.
* Changing the default value for a non-existent comment ID in `get_comment_author()` from an empty string to zero as a numeric string, for consistency with `get_comment_ID()`.

Follow-up to [52818], [55289], [58335], [58755].

Props narenin, mukesh27, iflairwebtechnologies, umeshsinghin, SergeyBiryukov.
Fixes #61715.
Built from https://develop.svn.wordpress.org/trunk@58809


git-svn-id: http://core.svn.wordpress.org/trunk@58205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-25 22:38:16 +00:00
Felix Arntz cd610922d0 Taxonomy: Ensure `get_edit_term_link()` produces the correct result when called without taxonomy.
This fixes an oversight missed in [36646].

Props debarghyabanerjee.
Fixes #61726.
See #35922.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 21:42:17 +00:00
dmsnell 539ee9221b HTML API: Add TABLE support in HTML Processor.
As part of work to add more spec support to the HTML API, this patch adds
support for various table-related insertion modes. This includes support
for tables, table rows, table cells, table column groups, etc...

Developed in https://github.com/wordpress/wordpress-develop/pull/6040
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 18:41:16 +00:00
hellofromTonya 7c1295fdb9 Customize: Sanitize autofocus URL parameter as an array.
[58069] introduced calling `sanitize_text_field()` with `$_REQUEST['autofocus']` (which is an array) and setting its default to a `string`. This fix restores the `array` data type for `autofocus`.

The fix also relocates the unsplash for `url`, `return`, and `autofocus` before sanitizing.

Follow-up to [58069], [34269], [29026], [21028].

Props jamesros161, swissspidy, dlh, audrasjb, hellofromTonya, ironprogrammer.
Fixes #61561.
Built from https://develop.svn.wordpress.org/trunk@58804


git-svn-id: http://core.svn.wordpress.org/trunk@58200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 16:23:17 +00:00
Sergey Biryukov 0702cafa87 Tests: Use more specific assertions in `get_comment_author()` tests.
Follow-up to [58335].

See #61530.
Built from https://develop.svn.wordpress.org/trunk@58803


git-svn-id: http://core.svn.wordpress.org/trunk@58199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 15:10:13 +00:00
Bernhard Reiter 8ab984897f block.json: Allow passing PHP filename as `variations` field.
Previously, the `variations` field in a block.json file could be used to provide a static list of the block's variations (i.e., an array). Alternatively, the block's `variation_callback` could be set during server-side block registration to point to a PHP function to generate those variations.

This changeset makes it so that the block.json `variations` field can be alternatively set to a string, which will be interpreted as the filename of a PHP file that generates the variations.

It is loosely modeled after [54132], which introduced the `render` field for `block.json`, as a way to point to a PHP file instead of providing a `render_callback`.

Props bernhard-reiter, gziolo.
Fixes #61280.
Built from https://develop.svn.wordpress.org/trunk@58801


git-svn-id: http://core.svn.wordpress.org/trunk@58197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 14:11:08 +00:00
desrosj 86754f2bc2 External Libraries: Update the `regenerator-runtime` library.
This updates the `regenerator-runtime` library to version `0.14.1`.

This library has not been used by Core itself in quite a while and only maintained as a courtesy. Any projects relying on `regenerator-runtime` should reevaluate their usage.

Props manooweb.
Fixes #60515.
Built from https://develop.svn.wordpress.org/trunk@58800


git-svn-id: http://core.svn.wordpress.org/trunk@58196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 14:07:17 +00:00
czapla 996817c3d9 Tests: Removes the obsolete Block Binding unregistration
Follow-up to [58798].
Props santosguillamot, cbravobernal, gziolo.
See #61641.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 11:31:18 +00:00
cbravobernal b104d200b6 Block Bindings: Adds sources in the editor settings to consume them in the client
Adds a new property `blockBindingsSources` to the editor settings to expose the block bindings sources registered in the server.

Props santosguillamot, cbravobernal, gziolo, artemiosans.
Fixes #61641.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 10:59:18 +00:00
noisysocks edb05c5809 Block themes: Enable block-level background image styles
Allows defining background images for blocks in theme.json.

Syncs PHP changes from https://github.com/WordPress/gutenberg/pull/60100.

Props ramonopoly, aaronrobertshaw.
Fixes #61588.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 00:26:14 +00:00
Tammie Lister afd60dd8a4 Twenty Twenty: Fixes Quote block border not reflecting alignment.
This resolves the border not also aligning with the quote block. When this theme was built the editor used style attributes for text alignment. This patch updates existing rules for center and right aligned quote blocks.

Props viralsampat, poena, sabernhardt.
Fixes #61132.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-23 21:52:15 +00:00