Commit Graph

49847 Commits

Author SHA1 Message Date
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
desrosj 584d36e618 Build/Test Tools: Update third-party GitHub Actions.
The following third-party actions have been updated to their latest versions.

- `shivammathur/setup-php` from `2.30.0` to `2.31.1`.
- `actions/setup-node` from `4.0.2` to `4.0.3`.
- `actions/cache` from `4.0.1` to `4.0.2`.
- `actions/upload-artifact` from `4.3.1` to `4.3.4`.
- `slackapi/slack-github-action` from `1.25.0` to `1.26.0`.
- `codecov/codecov-action` from `4.1.0` to `4.5.0`.

See #61564.
Built from https://develop.svn.wordpress.org/trunk@58789


git-svn-id: http://core.svn.wordpress.org/trunk@58191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-23 18:39:17 +00:00
Bernhard Reiter 4cecd0e731 Block Hooks: Don't erase post content if it isn't changed by client.
The `inject_ignored_hooked_blocks_metadata_attributes` filter that is attached to both the `rest_pre_insert_wp_template` and `rest_pre_insert_wp_template_part` hooks receives a `stdClass` object from the Templates REST API controller that contains all fields that the client would like to modify when making a `POST` request (plus the `id` to identify the relevant template or template part, respectively).

There are cases when the `post_content` field is not set, e.g. when the client would like to rename an existing template (in which case it would only set the `title` field).

Prior to this changeset, the filter would erroneously apply the Block Hooks algorithm to the non-existent `post_content` field regardless, which would result in it being set to the empty string `''`. As a consequence, renaming a template would have the unwanted side effect of wiping its contents.

This changeset fixes the issue by returning early from the filter if the `post_content` field is not set.

Props alshakero, bernhard-reiter.
Fixes #61550.
Built from https://develop.svn.wordpress.org/trunk@58785


git-svn-id: http://core.svn.wordpress.org/trunk@58187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-23 13:43:12 +00:00
Tammie Lister 7308b2518f Twenty Twenty: Fixes incorrect colour in editor for seperator block.
This resolves the seperator block color settings ordering. They were displaying incorrectly due to ruleset problems. This edits the order for the front end also.

Props bhaveshdesai13, aniketpatel, miguelaxcar, nidhidhandhukiya, poena, pavanpatil1, sabernhardr.
Fixes #57544.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-23 09:59:15 +00:00
youknowriad 21fb080d5c REST API: Remove post status prefix from REST API responses.
When using the /posts or /pages endpoints, for private posts or pages, you get the following title property: { raw: "Some title", rendered: "Private: Some title" }
this commit removes the prefix from rendered private posts titles (just like what we do for protected posts)

Props youknowriad, swissspidy, timothyblynjacobs, sergeybiryukov, ramonopoly.
Fixes #61639.
Built from https://develop.svn.wordpress.org/trunk@58783


git-svn-id: http://core.svn.wordpress.org/trunk@58185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-23 07:51:12 +00:00
Peter Wilson 2ecc281f69 Options, Meta APIs: Prime `notoptions` cache when deleting options.
Prime the `notoptions` cache within `delete_option` and `delete_network_option` to avoid the need for a database query if `get_option` or `get_network_option` is subsequently called.

Adds some associated tests to ensure that an option is cleared from the notoptions cache when an option is added either via `add_option`, `update_option` or their network option equivalent.

Props pbearne, mukesh27.
Fixes #61484.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-23 00:27:15 +00:00
dmsnell 8529edd888 HTML API: Fix unsupported insertion mode messages.
Insertion modes in an HTML parser may include instructions like "process
the token in the IN HEAD insertion mode." The rules do not change the
insertion mode of the parser, but the errors are triggered outside of the
rules for the current insertion mode. These will be misleading when
bailing on these instructions, because it will point someone to the wrong
place in the code to find the source of the error.

In this patch all of the bail-points due to lacking insertion mode support
are hard-coded to better orient someone to the section of the code lacking
support for handling the input HTML.

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

Follow-up to [58679].

Props: dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-22 23:21:14 +00:00
dmsnell 2d6e9a55cf HTML API: Remove empty test file after adding support for missing elements.
When support was added for the remaining tags in the IN BODY insertion mode, a test
file indicating that support was necessary for certain parts of the parser was
removed, but it wasn't removed from SVN when sending over the patch from `git`.

This patch removes that empty file so that the WPCS workflows pass.

Discussed in https://core.trac.wordpress.org/ticket/61576

Follow-up to [58779].

See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-22 22:51:13 +00:00
dmsnell 471b482bec HTML API: Add missing tags in IN BODY insertion mode to HTML Processor.
As part of work to add more spec support to the HTML API, this patch adds
support for the remaining missing tags in the IN BODY insertion mode. Not
all of the added tags are supported, because in some cases they reset the
insertion mode and are reprocessed where they will be rejected.

This patch also improves the support of `get_modifiable_text()`, removing
a leading newline inside a LISTING, PRE, or TEXTAREA element.

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

Props dmsnell, jonsurrell, westonruter.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-22 22:24:15 +00:00