Commit Graph

37324 Commits

Author SHA1 Message Date
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
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
Tammie Lister c4fbdf5eab Twenty Twenty: Fixes Customizer widget edit buttons being obstructed on smaller screens.
When the screen is smaller the edit buttons are obscured. This resolves that problem for the smaller screens and only targets the container for footer navigation and widgets.

Props sumitsingh, SergeyBiryukov, sabernhardt.
Fixes #49008.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-22 17:52:18 +00:00
Tammie Lister 62ea483f79 Twenty Sixteen: Fixes Quote block border width changes depending on font size.
When the font size is changed the border on the front was changing in width. This fix resolves that to make sure the width does not adjust.

Props nidhidhandhukiya, sabernhardt, kamran8176, pitamdey, shailu25.
Fixes #60239.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-22 16:30:16 +00:00
Tammie Lister 9b054b0ac6 Twenty Twelve: Fixes submenu hiding under slideshow block.
Whilst initially this could be thought to be solved in Jetpack due to submenus only having a z-index of 1 a fix is desirable. This brings in the suggested value.

Props robertghetau, SergeyBiryukov, sabernhardt, poena, narenin.
Fixes #55892.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-22 15:36:14 +00:00
youknowriad 97eacaa791 Build Tools: Use umd builds provided by React instead of bundling our own builds.
We tried moving away from the deprecated React UMD builds previously,
the problem we faced is that there's a warning that is triggered on the console because we're not using a separate impact for `createRoot`.

This warning has been removed in React 19 along with the removal of the UMD builds, so we should be able to revert this commit when we upgrade to React 19 but for now, we need to restore the usage of the umd builds.

Props mamaduka.
See #61324.
Built from https://develop.svn.wordpress.org/trunk@58775


git-svn-id: http://core.svn.wordpress.org/trunk@58177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-22 10:02:15 +00:00
Sergey Biryukov aeb2fc3083 I18N: Correctly output the `None` translatable strings.
Includes updating the context to match the pre-existing block editor translations.

Follow-up to [58284].

Props sabernhardt, Marius84.
Fixes #61714.
Built from https://develop.svn.wordpress.org/trunk@58774


git-svn-id: http://core.svn.wordpress.org/trunk@58176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-21 18:58:16 +00:00
Sergey Biryukov 45b948b0e4 Media: Check if content URL includes a hostname in `wp_calculate_image_srcset()`.
This resolves an `Undefined array key "host"` PHP warning if `WP_CONTENT_URL` is set to a relative URL.

Follow-up to [58097].

Props mattraines, narenin, pamprn, SergeyBiryukov.
Fixes #61690.
Built from https://develop.svn.wordpress.org/trunk@58773


git-svn-id: http://core.svn.wordpress.org/trunk@58175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-20 13:32:15 +00:00
Tammie Lister 9abf0d77e7 Twenty Fifteen: Fixes List Block with padding not having background color.
The List Block when had padding was not displaying the background color correctly. This only impacts the non-framed editor.

Props viralsampat, devtanbir, sabernhardt, deepakvijayan.
Fixes #60197.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-20 12:43:17 +00:00
Tammie Lister a75e8ef744 Multiple themes Fixes theme screen reader including text inside card.
The function twentysixteen_entry_meta included screen reader text inside the span property using the author mf class. This resolves that in both Twenty Sixteen and Twenty Fifteen. It should have the screen reader text inside the byline span but outside the author vcard span.

Props dshanske, laurelfulford, sabernhardt, shilu25.
Fixes #46233.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-20 10:57:14 +00:00
Tammie Lister d5f4f876fb Twenty Twenty-Four: Fixes typos in pattern descriptions.
There were a number of typos in the patterns. These came in [58111] with some additions having issues and so this resolves that.

Props tobifjellner, sabernhardt, audrasjb.
Fixes #61682.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-20 10:08:14 +00:00
dmsnell 51afccc65f HTML API: Add PHP type annotations.
This patch adds type annotations to internal and private methods of the HTML
API and the supporting WP_Token_Map. Annotations have not been added to the
public interfaces where it would likely crash a site if called wrong.

These annotations should help avoid unnecessary type-related bugs (as have
been uncovered in earlier work adding such annotations) and provide additional
guidance to developers when interacting with these classes in an IDE.

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

Props dmsnell, jonsurrell.
See #61399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-19 23:44:16 +00:00
Sergey Biryukov 2b2781cb0f Docs: Correct `@return` value for `_get_block_templates_files()`.
The function returns `null` if `$template_type` is not `wp_template` or `wp_template_part`.

Follow-up to [52062].

Props dilipbheda, mukesh27.
Fixes #61705.
Built from https://develop.svn.wordpress.org/trunk@58768


git-svn-id: http://core.svn.wordpress.org/trunk@58170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-19 15:56:16 +00:00
desrosj cdf6e7c128 Build/Test Tools: Ensure `TARGET_SHA` is set for older branches.
The `workflow_dispatch` event payload does not contain the `before` property containing the previous commit’s SHA value, which causes scheduled runs of the performance testing workflow in older branches to fail.

This adds a step specifically for this event type to use native Git commands to retrieve the required SHA value instead.

Props joemcgill.
Fixes #61699.
Built from https://develop.svn.wordpress.org/trunk@58767


git-svn-id: http://core.svn.wordpress.org/trunk@58169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-19 13:15:15 +00:00
Aaron Jorbin 23b0fdc142 General: Provide _is_utf8_charset() in compat.php for early use
#61182 introduced is_utf8_charset() as a way of standardizing checks for charset slugs referring to UTF-8. This is called by _mb_strlen() inside of compat.php, but is_utf8_charset() is defined in functions.php, which isn't loaded early on. Code calling mb_strlen() early on before functions.php loads in hosts without the multibyte extension therefore may crash.

Props dmsnell, jonsurrell, joemcgill, jorbin.
Fixes #61681.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-18 18:04:11 +00:00
hellofromTonya 5f637ea437 Editor: Update packages for 6.6.1.
Bugfixes included:

* [https://github.com/WordPress/gutenberg/pull/63637 Elements: Avoid specificity bump for top-level element-only selectors].
* [https://github.com/WordPress/gutenberg/pull/63406 Navigation block: Allow themes to override block library text-decoration rule].
* [https://github.com/WordPress/gutenberg/pull/63436 Fix invalid css for nested fullwidth layouts with zero padding applied].
* [https://github.com/WordPress/gutenberg/pull/63397 Prevent empty void at the bottom of editor when block directory results are present].
* [https://github.com/WordPress/gutenberg/pull/63291 Pattern overrides: Ensure "Reset" button always shows as last item and with border].
* [https://github.com/WordPress/gutenberg/pull/63562 Global Styles: Disable "Reset styles" button when there are no changes].
* [https://github.com/WordPress/gutenberg/pull/63093 Fix: Removed shuffle button when only 1 pattern is present].
* [https://github.com/WordPress/gutenberg/pull/62675 fix: wp icon focus issue].
* [https://github.com/WordPress/gutenberg/pull/63565 useBlockElement: return null until ref callback has time to clean up the old element].

Props ellatrix.
Fixes #61692.
See #61660, #61630, #61656.
Built from https://develop.svn.wordpress.org/trunk@58757


git-svn-id: http://core.svn.wordpress.org/trunk@58159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-18 16:03:23 +00:00
hellofromTonya bbfa972fe0 Coding Standards: Capitalize inline comment in get_comment_author() test dataset.
Per coding standards, capitalizes the first character of the inline comment in the test dataset.

Follow-up to [58755].

Props SergeyBiryukov.
See #61681.
Built from https://develop.svn.wordpress.org/trunk@58756


git-svn-id: http://core.svn.wordpress.org/trunk@58158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-18 15:19:15 +00:00
hellofromTonya 0a40c7728d Comments: Fix fatal error when get_comment_author() receives an object with no comment_id.
[58335] introduced `(string)` type casting of the passed in `$comment_id` value. If `$comment_id` is a scalar, it works as expected. But if it's an `object`, the following fatal error is thrown:

{{{
Object of class WP_Comment could not be converted to string
}}}

This fatal error happens when the incoming `$comment_id` is an instance of `WP_Comment` (or any object) without a `comment_ID` (empty). 

This changeset adds tests to demonstrate the fatal error and validate the fix.

It fixes the fatal error by restructuring the ternary checks into an `if/elseif/else` structure for the 3 paths:

- When `$comment->comment_ID` is not empty, then it uses the property.
- When `$comment_id` is scalar, then it type casts it to a `string`.
- Else, the default is an empty `string`.

Follow-up to [58335], [41127], [52818].

Props ambrosiawt, hellofromTonya, jorbin, mukesh27, SergeyBiryukov.
Fixes #61681.
Built from https://develop.svn.wordpress.org/trunk@58755


git-svn-id: http://core.svn.wordpress.org/trunk@58157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-18 15:09:15 +00:00
desrosj afc22cfd4a Build/Test Tools: Remove regular 6.2 & 6.3 branch performance testing.
Prior to WordPress 6.4, performance testing was performed using Puppeteer instead of Playwright (converted in [56926]). Because of the flaky nature of the workflow using Puppeteer, it was not converted to the reusable pattern implemented through #61213. It was instead removed from 6.2 and 6.3 in [58301] and [58330], respectively.

This removes the workflow for these branches from the strategy matrix when testing old branches to avoid errors and adds an expanded note about why those branches are missing.

See #61213, #61564.
Built from https://develop.svn.wordpress.org/trunk@58754


git-svn-id: http://core.svn.wordpress.org/trunk@58156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-18 14:11:14 +00:00
Sergey Biryukov 3870065e31 Upgrade/Install: Add missing files from the sodium_compat v1.21.1 update.
Follow-up to [58752].

Props paulkevan.
See #61686.
Built from https://develop.svn.wordpress.org/trunk@58753


git-svn-id: http://core.svn.wordpress.org/trunk@58155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-18 13:48:15 +00:00
Sergey Biryukov f0b4b44d1e Upgrade/Install: Update sodium_compat to v1.21.1.
The latest version of sodium_compat includes support for AEGIS and preliminary support for PHP 8.4.

Additionally, the PHP 8.2+ `SensitiveParameter` attribute is now applied where appropriate to functions in the public API. This attribute is used to mark parameters that are sensitive and should be redacted from stack traces.

References:
* [https://github.com/paragonie/sodium_compat/releases/tag/v1.21.0 sodium_compat 1.21.0 release notes]
* [https://github.com/paragonie/sodium_compat/releases/tag/v1.21.1 sodium_compat 1.21.1 release notes]
* [https://github.com/paragonie/sodium_compat/compare/v1.20.0...v1.21.1 Full list of changes in sodium_compat 1.21.1]

Follow-up to [49741], [51002], [51591], [52988], [54150], [54310], [55699].

Props jrf, dd32, paragoninitiativeenterprises.
Fixes #61686.
Built from https://develop.svn.wordpress.org/trunk@58752


git-svn-id: http://core.svn.wordpress.org/trunk@58154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-18 13:00:16 +00:00
noisysocks ab39abeed7 Block Themes: Fix invalid css for nested fullwidth layouts with zero padding applied
In the Layout block support, handle 0 values for padding as 0px in calc()
rules. This resolves a bug for nested fullwidth layouts when zero padding is
applied. Due to how calc() works, without supplying the unit, the rule will not
work, resulting in a horizontal scrollbar.

Backports the PHP changes in https://github.com/WordPress/gutenberg/pull/63436.

Fixes #61656.
Props andrewserong, mukesh27, aaronrobertshaw.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-18 06:50:10 +00:00
noisysocks a4e3fdfa3a Block Themes: Avoid specificity bump for top-level element-only selectors
Prevent issues (e.g. links being underlined) caused by a bump in CSS
specificity for top-level element-only global element styles.

Backports the PHP changes from https://github.com/WordPress/gutenberg/pull/63403.

Fixes #61630.
Fixes #61660.
Props aaronrobertshaw, andrewserong, noisysocks.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-18 06:43:18 +00:00
joedolson 05c7351e53 Toolbar: Move user and recovery menus to a higher priority.
Following [58215], admin bar items in the `top-secondary` group have a changed visual order. Increase the priority of the user and recovery menu items so nodes added with higher priorities will still be shown visually before the user and recovery menu items, as they were prior to 58215.

The items will appear in the reverse of the previous order, but the new order now matches their priority order, rather than being the opposite.

Props sabernhardt, joemcgill, pbiron, joedolson.
Fixes #61615.
Built from https://develop.svn.wordpress.org/trunk@58748


git-svn-id: http://core.svn.wordpress.org/trunk@58150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-18 00:52:17 +00:00
joedolson 46485f9db4 Editor: Limit scope of resizable menu container CSS.
The CSS to make menu item containers resizable in the admin menu editor was too broadly scoped, and caused classic editor metaboxes to have unconstrained height. Limit the scope of the CSS changes to only impact menu item containers.

Props neotrope, sabernhardt, joedolson.
Fixes #61662.
Built from https://develop.svn.wordpress.org/trunk@58747


git-svn-id: http://core.svn.wordpress.org/trunk@58149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-17 23:37:16 +00:00
Sergey Biryukov 51d8a8ea62 Docs: Add missing description for the `display_rows()` method in list table classes.
Follow-up to [15491], [17002], [27301].

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


git-svn-id: http://core.svn.wordpress.org/trunk@58147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-17 15:43:15 +00:00
davidbaumwald 4538fa7498 Upgrade/Install: Update the `$_old_files` array for 6.6.
Props dd32, audrasjb, hellofromTonya.
Fixes #61665.
Built from https://develop.svn.wordpress.org/trunk@58744


git-svn-id: http://core.svn.wordpress.org/trunk@58146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-17 13:35:15 +00:00
Sergey Biryukov 04358f497d Docs: Fix typo in a comment in `wp.media.view.Attachment.Details.TwoColumn`.
Follow-up to [41351].

Props devansh2002, mukesh27.
Fixes #61658.
Built from https://develop.svn.wordpress.org/trunk@58743


git-svn-id: http://core.svn.wordpress.org/trunk@58145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-17 11:28:16 +00:00
dmsnell b7b504dc0d Fix phpdoc nullable types in some files.
It was found that in several places in the HTML API and its supporting files,
the wrong form of type annotation was used for optional parameters.

Instead of using `?type`, this patch uses `type|type-of-default-value` instead,
noting where important if the parameter is optional, and if so, what its default
value is.

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

Props dmsnell, jonsurrell.
See #61399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-17 00:53:17 +00:00
dmsnell c0f074c7ce HTML API: Test code improvements in virtual node breadcrumb tests.
Follow-up after feedback to newly-introduced tests,
mostly to enhance the message when the tests fail.

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

Follow-up to [58592].

Props dmsnell, jonsurrell.
See #61646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-17 00:35:14 +00:00
dmsnell 81fc8b3ddc HTML API: Remove leading whitespace after removing class names.
In part of a larger review of CSS semantics and behaviors, this patch
takes the opportunity to remove leading whitespace in an updated class
attribute after the first class in the attribute has been removed.

Previously, if the first class name had been removed, the whitespace
that formerly followed it would remain in the class attribute. This
stood in contrast to removing other class names, which removed their
associated whitespace.

There should be no semantic or functional changes in this patch, only
a slightly-large diff for modified HTML documents that looks prettier
when removing the first class name in a class attribute.

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

Props dmsnell, jonsurrell.
See #61531.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-17 00:12:18 +00:00
hellofromTonya 4007d27204 Tests: Use data provider in Tests_Interactivity_API_wpInteractivityAPIFunctions.
Refactors the following tests to use a data provider with named test cases:
* `test_wp_interactivity_data_wp_context_with_different_arrays()`
* `test_wp_interactivity_data_wp_context_with_different_arrays_and_a_namespace()`
* `test_wp_interactivity_data_wp_context_with_json_flags()`

This is better as:
1. One failing test will not block the other tests from running.
2. Each test is now referenced by name in any error message, making it more straight forward to see which test failed.
3. The test no longer contains multiple assertions.
3. It makes it more straight forward to add additional tests.

Follow-up to [58594], [58234], [57762], [57743], [57742], [57563].

Props jrf.
See #61530.
Built from https://develop.svn.wordpress.org/trunk@58739


git-svn-id: http://core.svn.wordpress.org/trunk@58141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-16 18:39:12 +00:00
hellofromTonya 4c2edeb04a Tests: Don't declare nested named function in Tests_Interactivity_API_wpInteractivityAPIFunctions.
Once the `test_process_directives_when_block_is_filtered()` method has run, the named `test_render_block_data()` function declared nested within becomes part of the global namespace, which could cause problems for other tests.

Quite apart from the fact that the name starting with `test_`  is confusing (as methods prefixed with `test_` are supposed to be test methods to be run by PHPUnit).

Using a closure for this callback fixes the issue. Declared as `static` for a micro-optimization.

Follow-up to [57826].

Props jrf, hellofromTonya.
See #61530.
Built from https://develop.svn.wordpress.org/trunk@58738


git-svn-id: http://core.svn.wordpress.org/trunk@58140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-16 18:22:18 +00:00
dmsnell db0e0abe14 HTML API: Add tests confirming comment behavior in HTML Processor.
There was a bug-fix late in the 6.6 cycle in the HTML Processor which
resolved an issue with the wrong name being reported when paused at
processing-instruction look-alike invalid comments, but no tests were
added to enforce the correct behaviors.

This patch adds the missing tests.

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

Follow-up to [58304], [58558].

Props dmsnell, jonsurrell.
See #61530.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-16 16:02:11 +00:00
hellofromTonya acdd4a5cbb HTML API: Fix "${var} in strings" deprecation notice in html5lib test.
Changeset [58712] introduced the following compile time PHP deprecation notice on >= PHP 8.2 test runs:

{{{
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php on line 257
PHPUnit 9.6.20 by Sebastian Bergmann and contributors.
}}}

The `${` syntax for string interpolation was deprecated in PHP 8.2 and should not be used anymore.

Ref: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation

Follow-up to [58712].

Props jrf.
See #61530, #59654, #61576.
Built from https://develop.svn.wordpress.org/trunk@58733


git-svn-id: http://core.svn.wordpress.org/trunk@58135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-16 14:35:16 +00:00
Tammie Lister b079b72a24 Multiple themes: Comments Reply heading and Cancel reply link did not have spacing.
This brings spacing in that was missing for both Twenty Seventeen and also Twenty Nineteen. It was missing between the words.

Props pitamdey, sabernhardt, nidhidhandhukiya, poena.
Fixes #59334.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-16 13:22:15 +00:00
Tammie Lister 112eb192f1 Multiple themes: Verse block font family different on front.
The font family was not showing correctly for the verse block. The approach taken was to match the front end and this involved also removing the styles in [50358].

Props pranitdugad, sabernhardt, poena, pitamdey.
Fixes #61140.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-16 10:04:13 +00:00
Tammie Lister 6f694a5983 Twenty Fifteen: Fixes code block family being different in iframe editor.
The font family was not being included for the code block. This adds Inconsolata to the code block within the editor styles.

Props pranitdugad, sabernhardt.
Fixes #61571.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-16 09:50:10 +00:00
Bernhard Reiter c89fb9823f Interactivity API: Use Script Modules filter for store & config data.
A dedicated API exists for passing data to Script Modules implemented in changeset [58579].
Use this Core API instead of a custom implementation for Interactivity API to pass data to the client.

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

Props jonsurrell, gziolo, luisherranz, cbravobernal.
Fixes #61512.
Built from https://develop.svn.wordpress.org/trunk@58729


git-svn-id: http://core.svn.wordpress.org/trunk@58131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-16 09:44:14 +00:00
Tammie Lister 9d3bf29704 Twenty Sixteen: Fixes quote block border not changing color.
The border was not changing color when it was changed. This brings that in. It is worth noting the original theme design did not have this but as noted in the ticket this has been in the quote block for about two years so matching the current block styling in this case makes sense.

Props umesh84, desrosj, sabernhardt.
Fixes #56565.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-16 09:39:17 +00:00
Tammie Lister a8517c8293 Twenty Twenty-Two: Fixes search block not showing selected border on bottom.
The border was not showing on search block. This brings in a resolution for that removing the none from border property.

Props viralsampat, poena, sabernhardt.
Fixes #60669.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-15 19:55:13 +00:00
Tammie Lister 98ef1859bd Twenty Twenty-One: Fixes alignment of site title and navigation links.
There was a text alignment issue not centering on all screen sizes. This fixes that and centers vertically.

Props vijaysinh9094, poena, sabernhardt.
Fixes #61633.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-15 19:45:17 +00:00
Tammie Lister 31b1f8dfa4 Twenty Sixteen: Fixes button block letter spacing control.
The button block had issues with font styling not applying. This not only brings letter-spacing but also line-height, text-transform and font-weight to wp-button-block-buttons. [57300] fixed the separator issue. This fix also added box-shadow none for consistency.

Props darshitrajyaguru97, harshgajipara, shailu25, sabernhardt, alvitazwar052.
Fixes #58609.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-15 18:12:12 +00:00
Tammie Lister 84510fb69b Twenty Fifteen: Fixes pullquote issues with text color and border
Pullquote was not showing the color changes. This uses inherit to do that. It also removes the changes from [58368] as this method is preferred.

Props viralsampat, poena, sabernhardt.
Fixes #59801.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-15 16:58:15 +00:00
ellatrix 2f9ff5ebe6 Editor: Update packages for 6.6 RC 4.
This package update includes only one revert PR:

https://github.com/WordPress/gutenberg/pull/63412

You can confirm the changes in this package update here:

https://github.com/WordPress/gutenberg/commits/wp/6.6/

Fixes #61654.

Props santosguillamot.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-15 14:17:17 +00:00
davidbaumwald 5d4375f46f Bundled Themes: Bump default theme versions for release with 6.6.
This updates the version of each default theme to the following versions:
- Twenty Ten: 4.2
- Twenty Eleven: 4.7
- Twenty Twelve: 4.3
- Twenty Thirteen: 4.2
- Twenty Fourteen: 4.0
- Twenty Fifteen: 3.8
- Twenty Sixteen: 3.3
- Twenty Seventeen: 3.7
- Twenty Nineteen: 2.9
- Twenty Twenty: 2.7
- Twenty Twenty-One: 2.3
- Twenty Twenty-Two: 1.8
- Twenty Twenty-Three: 1.5
- Twenty Twenty-Four: 1.2

These versions will released in coordination with WordPress 6.6.

Props sabernhardt, shail-mehta, rudlinkon.
Fixes #60701.
Built from https://develop.svn.wordpress.org/trunk@58718


git-svn-id: http://core.svn.wordpress.org/trunk@58120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-15 13:59:16 +00:00
Sergey Biryukov 16b7936d9f Docs: Correct documentation for `_wp_preview_meta_filter()`.
The `$single` parameter is passed via the `get_post_metadata` filter and has no default value.

Includes minor code layout fixes for consistency with the formatting of other long conditionals in core.

Follow-up to [56714].

Props rodrigosprimo.
Fixes #61645.
Built from https://develop.svn.wordpress.org/trunk@58717


git-svn-id: http://core.svn.wordpress.org/trunk@58119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-15 01:59:16 +00:00
Sergey Biryukov f091afc696 Site Health: Correctly display auto-update status for parent theme.
Follow-up to [47835], [48731].

Props apermo.
Fixes #61649. See #61648.
Built from https://develop.svn.wordpress.org/trunk@58716


git-svn-id: http://core.svn.wordpress.org/trunk@58118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-14 03:47:16 +00:00
Sergey Biryukov 667521c97f Filesystem API: Add a return value for `wp_delete_file()`.
This addresses a discrepancy where using `unlink()` allows for checking if it was successful via the return value, but `wp_delete_file()` did not have a return value, making it impossible to verify the result without doing overhead checks if the file still exists.

This also brings more consistency with the other `wp_delete_*()` functions, specifically:

* `wp_delete_file_from_directory()`
* `wp_delete_post()`
* `wp_delete_post_revision()`
* `wp_delete_attachment()`
* `wp_delete_attachment_files()`
* `wp_delete_comment()`
* `wp_delete_nav_menu()`
* `wp_delete_term()`
* `wp_delete_site()`
* `wp_delete_user()`

Includes adding basic unit tests for `wp_delete_file()`.

Follow-up to [31575].

Props bedas, debarghyabanerjee, mukesh27, SergeyBiryukov.
Fixes #61590.
Built from https://develop.svn.wordpress.org/trunk@58715


git-svn-id: http://core.svn.wordpress.org/trunk@58117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-13 05:03:16 +00:00
dmsnell 4f85cc258c HTML API: Add context to Unsupported_Exception class for improved debugging.
The HTML Processor internally throws an exception when it reaches HTML
that it knows it cannot process, but this exception is not made
available to calling code. It can be useful to extract more knowledge
about why it gave up, especially for debugging purposes.

In this patch, more context is added to the WP_HTML_Unsupported_Exception
and the last exception is made available to calling code through a new
method, `get_unsupported_exception()`.

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

Props bernhard-reiter, dmsnell, jonsurrell.
See #61646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-12 22:29:13 +00:00
dmsnell 519a8f6bbd HTML API: Simplify breadcrumb accounting.
Since the HTML Processor started visiting all nodes in a document, both
real and virtual, the breadcrumb accounting became a bit complicated
and it's not entirely clear that it is fully reliable.

In this patch the breadcrumbs are rebuilt separately from the stack of
open elements in order to eliminate the problem of the stateful stack
interactions and the post-hoc event queue.

Breadcrumbs are greatly simplified as a result, and more verifiably
correct, in this construction.

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

Follow-up to [58590].

Props bernhard-reiter, dmsnell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-12 22:20:15 +00:00
dmsnell befa5f9c92 HTML API: Join successive text nodes in html5lib test representation.
Many tests from the html5lib test suite fail because of differences in
text handling between a DOM API and the HTML API, even though the
semantics of the parse are equivalent. For example, it's possible in
the HTML API to read multiple successive text nodes when the tokens
between them are ignored.

The test suite didn't account for this and so was failing tests. This
patch improves the construction of the representation to compare
against the test suite so that those tests don't fail inaccurately.

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

Props bernhard-reiter, dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-12 22:00:14 +00:00
Joe McGill 897ec27a81 Editor: Revert caching of global styles for blocks.
This reverts [58334] to fix a bug where edits to block styles made in the site editor were not showing in the front end.

Props joemcgill, spacedmonkey, andrewserong, hellofromtonya, audrasjb.
See #59595.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-12 19:26:14 +00:00
Sergey Biryukov 1287cb6181 KSES: Add `opacity` to the list of safe CSS properties.
Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/59891 #59891 Update overlay step function in cover block]

Reference: [https://developer.mozilla.org/en-US/docs/Web/CSS/opacity MDN Web Docs: opacity].

Props sunil25393, wildworks, poena, Mamaduka, presstoke.
Fixes #61536.
Built from https://develop.svn.wordpress.org/trunk@58709


git-svn-id: http://core.svn.wordpress.org/trunk@58111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-12 03:36:15 +00:00
isabel_brison 981871c922 Editor: remove Group inner container from Grid variation in classic themes.
Updates the logic in the layout filter that replaces the Group block inner container in classic themes to exclude the Grid variation.

Props isabel_brison, aaronrobertshaw, andrewserong.
See #61635.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-12 01:34:15 +00:00
hellofromTonya 80784d8b9d Docs: Fix multi-line inline comments in WP_REST_Templates_Controller.
Converts single inline comment formatting into multi-line inline comment formatting, per the coding standards.

Ref: https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#5-inline-comments

Follow-up to [58303], [57366].

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


git-svn-id: http://core.svn.wordpress.org/trunk@58109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-11 13:40:15 +00:00
Sergey Biryukov 99effa2d51 Docs: Fix typos in various REST API DocBlocks and comments.
Follow-up to [34928], [43739], [46422], [50717], [51973], [54528].

Props antonvlasenko.
Fixes #61593.
Built from https://develop.svn.wordpress.org/trunk@58706


git-svn-id: http://core.svn.wordpress.org/trunk@58108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-11 06:24:17 +00:00
hellofromTonya 70c9c49f9b REST API: Ensure string returned in WP_REST_Templates_Controller::get_wp_templates_author_text_field().
Adds a fail-safe to return an empty string should the `switch` ever fall through without returning.

Currently, `WP_REST_Templates_Controller::get_wp_templates_author_text_field()` is tightly coupled to `WP_REST_Templates_Controller::get_wp_templates_original_source_field()`. However, if the `$original_source` values change in either method, but not both, it is possible a `void` or `null` will be returned, rather than a `string`.

Follow-up to [57366].

Props antonvlasenko, hellofromTonya, debarghyabanerjee.
Fixes #61580.
Built from https://develop.svn.wordpress.org/trunk@58705


git-svn-id: http://core.svn.wordpress.org/trunk@58107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-10 21:25:11 +00:00
Sergey Biryukov a5efdd1cc9 Docs: Correct `@return` values for a few REST API class methods.
Includes listing the expected type first, instead of `WP_Error`.

Follow-up to [39031], [39033], [46696], [49927], [49929], [50993], [51286], [51973], [52079], [52286], [53152], [56415].

Props antonvlasenko.
See #61593.
Built from https://develop.svn.wordpress.org/trunk@58704


git-svn-id: http://core.svn.wordpress.org/trunk@58106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-10 11:12:16 +00:00
isabel_brison ccc46f8ada Editor: enqueue block custom CSS only when block renders on the page.
Updates the global styles custom CSS handling logic to be consistent with other global styles and take advantage of conditional enqueuing of block styles.

Props isabel_brison, aaronrobertshaw, andrewserong.
Fixes #61395.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-10 06:19:17 +00:00
dmsnell 85092d6493 HTML API: Correct node name in `generate_implied_end_tags()`.
The `generate_implied_end_tags()` algorithm has been comparing the
current node to a list of node names, which means that it won't ever
pop any elements from the stack of open elements.

This patch corrects the mistake by comparing node name against the
list, thus fixing the algorithm. This was noted in development work
for the 6.7 release.

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

Props dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-09 21:45:17 +00:00
Sergey Biryukov ad3c5a4946 REST API: Remove a few unused variables in `foreach` loops.
Follow-up to [38832], [48173], [49132], [49925].

Props antonvlasenko.
See #61593.
Built from https://develop.svn.wordpress.org/trunk@58694


git-svn-id: http://core.svn.wordpress.org/trunk@58096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-09 13:53:16 +00:00
ellatrix 6d7e0b6a60 Editor: Update packages for 6.6 RC 3.
Fixes #61603.
Fixes https://github.com/WordPress/wordpress-develop/pull/6998.
See https://make.wordpress.org/core/handbook/about/release-cycle/block-editor-release-process-for-major-releases/#package-updates-and-core-patches.

Props ellatrix, youknowriad.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-09 13:45:25 +00:00
ellatrix c56593dfe1 Section Styles: Fix ref values within block style variations.
Fixes #61589.
Fixes https://github.com/WordPress/wordpress-develop/pull/6989.
See https://github.com/WordPress/gutenberg/pull/63172.

Props aaronrobertshaw, andrewserong, ramonopoly.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-09 10:24:19 +00:00
ellatrix 5e060bc838 Section Styles: Prevent flash of variation style updates.
This is fixed by preloading the styles.

Fixes #61589.
Fixes https://github.com/WordPress/wordpress-develop/pull/6989.
See https://github.com/WordPress/gutenberg/pull/63172.

Props aaronrobertshaw, andrewserong, ramonopoly.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-09 10:02:21 +00:00
Tammie Lister bb14ea362e Twenty Sixteen: Fixes pullquote issues with border spacing.
Pullquote spacings wasn't reflected on front when using border settings. This caused double borders which was due to styling but this was done before optional borders were implemented. The pull request chosen presumes when you have an external border you no longer want the internal one but does look visually better. 

Props nidhidhandhukiya, huzaifaalmesbah, poena, sabernhardt.
Fixes #59754.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-08 15:44:16 +00:00
Sergey Biryukov 1d9524c836 REST API: Correct variable type in `WP_Rest_Server::serve_batch_request_v1()`.
`wp_parse_str()` expects an array as the second parameter.

Follow-up to [49252].

Props antonvlasenko.
See #61593.
Built from https://develop.svn.wordpress.org/trunk@58688


git-svn-id: http://core.svn.wordpress.org/trunk@58090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-08 13:25:18 +00:00
Tammie Lister 54b2903296 Twenty Seventeen: Fixes front page panels allow pages of any status to be shown.
If you have a published page set to a section but also private, draft, pending or trash at some point in the future it was still showing on the homepage. There was no clarity to the user what was happening. This adds in a check to the post_status variable before displaying panel content and adjusts the customizer to show a placeholder if the page is draft,trashed,deleted. 

Props brettshumaker, sabernhardt.
Fixes #46604.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-08 10:45:18 +00:00
Tammie Lister 7414d12f0d Twenty Fourteen: Updates styles for Table block and figure captions.
There were multiple discrepancies between the editor and front end with [58399] matched incorrect border color due to specificity. This resolves that and also includes issues not caught in [60293]. The full list of what this does is in ticket but a summary is reduces specificity for table cell border, removes border color rules, replaces selectors and adds wrapper so alignment changes within the iframe.

Props sabernhardt.
Fixes #61563.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-08 08:31:13 +00:00
isabel_brison eaada5a23c Editor: fix root padding for alignwide blocks.
Updates the root padding CSS selectors so wide width container blocks with constrained layout don’t receive padding.

Props isabel_brison, mukesh27, aaronrobertshaw.
Fixes #61587.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-08 06:41:14 +00:00
Sergey Biryukov 61c8c315a9 Code Modernization: Replace `substr( PHP_OS, 0, 3 )` calls with `PHP_OS_FAMILY`.
The `PHP_OS_FAMILY` constant indicates the operating system family PHP was built for, and is available as of PHP 7.2.0.

Reference: [https://www.php.net/manual/en/reserved.constants.php#constant.php-os-family PHP Manual: Predefined Constants: PHP_OS_FAMILY].

Follow-up to [23255], [57753], [57985], [58678].

Props ayeshrajans, jrf.
See #61574.
Built from https://develop.svn.wordpress.org/trunk@58684


git-svn-id: http://core.svn.wordpress.org/trunk@58086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-07 12:44:16 +00:00
Sergey Biryukov 82ef77948a Code Modernization: Simplify a conditional in `wp_is_ini_value_changeable()`.
This commit reverts the code to the code from before the bug fix related to PHP 5.2.6–5.2.17.

As support for PHP 5.2 has been dropped, the workaround for the PHP 5.2 bug is no longer needed.

Follow-up to [38015], [38017], [44950], [45058], [57985], [58678], [58682].

Props jrf, ayeshrajans.
See #61574.
Built from https://develop.svn.wordpress.org/trunk@58683


git-svn-id: http://core.svn.wordpress.org/trunk@58085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-06 15:07:08 +00:00
Sergey Biryukov 11fb201256 Code Modernization: Remove obsolete comments about older PHP versions.
This commit:
* Removes various comments referencing PHP versions which are no longer supported.
* Removes various comments containing “hints” of things to do after a particular PHP version drop. These hints are incorrect/not actionable for various reasons, so have no value:
 * Even though a function could be turned into a closure, removing the function would be a backward compatibility break which is not acceptable, so this suggestion is not actionable.
 * Short ternaries are forbidden by the coding standard exactly to prevent the faulty code suggested in the comment from getting into the codebase.

Follow-up to [1243/tests], [6543], [11816], [29861], [29864], [34928], [35369], [36698], [38694], [50786], [58678].

Props jrf, ayeshrajans.
See #61574.
Built from https://develop.svn.wordpress.org/trunk@58682


git-svn-id: http://core.svn.wordpress.org/trunk@58084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-06 14:54:16 +00:00
dmsnell bccb3e46e1 HTML API: Respect `tag_name` query arg in `HTML_Processor::next_tag()`
Previously the HTML Processor was ignoring the `tag_name` argument in
the `next_tag()` query if it existed. This was wrong adn would lead to
calling code finding the very next tag, regardless of tag name, instead
of the requested taag.

This patch adds the tag name detection code into `next_tag()` to fix
the bug and ensure that `next_tag()` always returns only when finding
a tag of the given name.

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

Follow-up to [56274].

Fixes #61581.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-06 10:20:15 +00:00
dmsnell 2bcd388bf9 HTML API: Fix wrong @since tag.
When the remaining insertion modes were stubbed in the HTML Processor,
a `@since` tag was mistakenly copied with 6.4.0 instead of 6.7.0.

This patch fixes the invalid tag.

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

Follow-up to [58679].

Props tobiasbg.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-05 22:23:14 +00:00
dmsnell e1c3eab4ce HTML API: Stub out remaining insertion modes in the HTML Processor.
As part of work to add more spec support to the HTML API, this patch adds
stubs for all of the remaining parser insertion modes in the HTML Processor.
These modes are not all supported yet, but they will be necessary to continue
adding support for other tags and markup.

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

Props dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-05 16:39:17 +00:00
Sergey Biryukov 6ff382af63 Code Modernization: Remove obsolete code targeting PHP < 7.2.24.
Follow-up to [44488], [45262], [53426], [57985].

Props ayeshrajans, jrf.
See #61574.
Built from https://develop.svn.wordpress.org/trunk@58678


git-svn-id: http://core.svn.wordpress.org/trunk@58080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-05 10:12:16 +00:00
dmsnell 411205cf87 HTML API: Support SELECT insertion mode.
As part of work to add more spec support to the HTML API, this patch adds
support for the SELECT, OPTION, and OPTGROUP elements, including the
requisite support for the IN SELECT insertion mode.

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

Props dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-05 00:52:18 +00:00
dmsnell bb1da1f82e HTML API: Add `current_node_is()` helper method to stack of open elements.
As part of work to add more spec support to the HTML API, this new method
will make it easier to implement the logic when in the SELECT and TABLE
insertion modes.

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

Props dmsnell, jonsurrell.
See #61576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-04 23:16:16 +00:00
dmsnell 8269c3fcd6 Users: Avoid ambiguous password reset URLs for usernames ending in a period.
When WordPress sends out a password-reset or new-user email, it generates
a link for someone to follow in order to take them to the reset page. If
the user login name ends in a period, however, that generated URL will
end in a period and many email clients will confuse it with a
sentence-ending period instead of being part of the query arguments.

In this patch, the generated URL's query argument are rearranged so that
the link will never end in a period. Alternative ideas were explored to
create a new function to escape URL-ending periods, but this patch resolves
the reported problem without raising any further architectural questions.

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

Props audrasjb, costdev, daveagp, dmsnell, hellofromTonya, markparnell, mukesh27, nhrrob, obrienlabs, paulcline.
Fixes #42957.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-04 22:01:22 +00:00
Sergey Biryukov 99c9e42672 Tests: Use `assertSame()` in `WP_REST_Global_Styles_Revisions_Controller` tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [56082].

See #61573.
Built from https://develop.svn.wordpress.org/trunk@58673


git-svn-id: http://core.svn.wordpress.org/trunk@58075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-04 15:11:20 +00:00
desrosj 2d64abf8a7 Docs: Update AJAX in Plugins HelpHub link to avoid unnecessary redirection.
Follow-up to [17045], [20713], [41065], [45674], [55412], [57854], [58131], [58132].

Props shailu25.
See #60732, #60699.
Built from https://develop.svn.wordpress.org/trunk@58672


git-svn-id: http://core.svn.wordpress.org/trunk@58074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-04 11:22:13 +00:00
Peter Wilson 876374d3e9 Help/About: Update performance improvements string.
Updates the performance improvements string with the finalized percentage improvement in the editor and to improve styling and language consistency.

Props ryelle, annezazu, peterwilsoncc.
Fixes #61320.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-04 04:20:19 +00:00
dmsnell eda0d41f46 HTML API: Implement the _reset insertion mode appropriately_ algorithm.
In order to add support for the SELECT and TABLE tags in the HTML Processor, it
needs to implement the HTML algorithm named "reset the insertion mode
appropriately".

This patch implements that algorithm to unblock the additional tag support. The
algorithm resets the parsing mode after specific state changes in complicated
situations where alternative rules are in effect (such as rules governing how
the parser handles tags found within a TABLE element).

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

Props dmsnell, jonsurrell.
Fixes #61549.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-03 17:07:15 +00:00
desrosj 5569a5cf93 Build/Test Tools: Fix workflow names in test old branches workflow.
After the changes in [58165] and [58645] and all associated backports, the workflow that dispatches regular testing in older branches needed to be updated.
- The `test-npm.yml` workflow no longer exists.
- The `test-build-processes.yml` has taken the place of `test-npm.yml` in all branches.

Also, the workflow will now run whenever an old version of the reusable PHPUnit workflow is updated (v1 or v2). This is to ensure the changes don’t cause any compatibility problems in older branches.

See #61213.
Built from https://develop.svn.wordpress.org/trunk@58654


git-svn-id: http://core.svn.wordpress.org/trunk@58069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-03 16:30:20 +00:00
Sergey Biryukov ed0762ad01 Users: Pass the previous state of the user as context to the `wp_set_password` hook.
Follow-up to [55056], [55250].

Props dd32.
Fixes #61541.
Built from https://develop.svn.wordpress.org/trunk@58653


git-svn-id: http://core.svn.wordpress.org/trunk@58068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-03 16:10:16 +00:00
desrosj f59d23e7f1 Build/Test Tools: Rename current reusable PHPUnit workflow.
This adds a ` -v3` suffix to the current reusable PHPUnit workflow name. This avoids having to update older branches in the future when the workflow’s logic drastically changes and a `v4` is needed.

See #61213.
Built from https://develop.svn.wordpress.org/trunk@58645


git-svn-id: http://core.svn.wordpress.org/trunk@58065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-03 15:53:14 +00:00
Tammie Lister e7370bd83b Twenty Sixteen: Fixes editor styles for table and calendar blocks and captions.
The table and calendar block font sizes were not as expected on front end within editor. This includes changes for header cells (th), removes redundant font size rules, corrects font-weight and updates figcaption selector along with editing text alignment and adding RTL font selection.

Props nidhidhandhukiya, sabernhardt, sheulyshila, iamfarhan09, bijit027, jannathsyeda, pooja1210, shailu25, hmbashar.
Fixes #58355.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-03 11:04:12 +00:00
Tammie Lister 4d6f01b32d Twenty Seventeen and Twenty Ten: Fixes gallery captions being at the bottom of images.
The margin specified in this theme caused issues when the gallery was placed in another block. This fix covers both themes as the selector is used within both.

Props pevogam, sabernhardt.
Fixes #58362.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-03 10:47:16 +00:00
Tammie Lister f54e344ed8 Twenty Ten: Fixes table and calendar block font size issues.
The table and calendar block font sizes were not the same on front and in editor. This resolves in using relative line-height.

Props iamfarhan09, bijit027, sabernhardt.
Fixes #58362.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-03 10:29:16 +00:00
noisysocks 27d7112e88 Themes: add "description" key to i18n schema
Add "description" key to the theme.json i18n schema.

Follows r56041.
Fixes #61543.
Props ramonopoly, oandregal.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-02 23:25:18 +00:00
dmsnell 66e0296b73 HTML API: Add missing insertion mode constants.
As the HTML Processor starts to support other insertion modes outside of
"IN BODY" it needs to be aware of those other modes. This patch
introduces the missing insertion modes in preparation for adding that
support.

Extracted as necessary prep work to the following more complete change:
https://github.com/WordPress/wordpress-develop/pull/6020

Props jonsurrell.
See #61549.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-02 21:47:15 +00:00
Tammie Lister 216010de95 Twenty Nineteen: Fixes font size and citation display for Pullquote block.
The pullquote block text decoration was not the same front and within the editor. This resolves that and resets.

Props pitamdey, viralsampat, sabernhardt.
Fixes #61507.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-02 20:48:15 +00:00
Tammie Lister 98148173c6 Twenty Twenty-One: Resolves bug on primary navigation.
The primary navigation was stuck in a vertical list when resize. This resolves that with positioning.

Props nek285, mukesh27.
Fixes #52663.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-02 20:36:17 +00:00
Tammie Lister 8d260fe6ed Twenty Nineteen: Adds center alignment to Archives and Categories List blocks.
When selecting center alignment for Archives or Categories List blocks the alignment was not matching. It is worth noting this fixes for these blocks but another ticket could be made to fix for titles.

Props pranitdugad, sabernhardt.
Fixes #47044.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-02 20:01:16 +00:00
Sergey Biryukov 144cc650b9 Login and Registration: Remove redundant escaping in `wp-login.php`.
* `$user_login` in the `login` action is already escaped on output.
* `$user_login` and `$user_email` in the `register` action are already unslashed a few lines above.

Follow-up to [3120], [4339], [8454], [11104], [23416], [23554], [23594], [46640].

Props johnjamesjacoby, rajinsharwar, narenin.
Fixes #55335.
Built from https://develop.svn.wordpress.org/trunk@58623


git-svn-id: http://core.svn.wordpress.org/trunk@58056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-02 17:46:15 +00:00
ryelle b048f2a054 Help/About: Add images to the About page.
The images have been uploaded to the w.org CDN and added into the About page. Additionally, the link to the release page has been fixed, and an extra translator note about the escaped percent sign has been added.

Follow-up to [58568].

Props ryelle, joen.
See #61320.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-02 15:15:18 +00:00
ellatrix 3c53d98912 Editor: Update packages for 6.6 RC 2.
Fixes #61548.
Fixes https://github.com/WordPress/wordpress-develop/pull/6953.

See https://make.wordpress.org/core/handbook/about/release-cycle/block-editor-release-process-for-major-releases/#package-updates-and-core-patches.

Props ellatrix, youknowriad.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-02 14:53:30 +00:00
costdev bc86b48d56 Plugins: Remove extra paragraph from plugin row dependency notice.
In `WP_Plugins_List_Table::add_dependencies_to_dependent_plugin_row()`, a `sprintf()` call previously wrapped the `%2$s` placeholder in paragraph tags.

[57769] changed the placeholder's value to use `wp_get_admin_notice()`, which returns a paragraph-wrapped notice by default. As a result, the previous paragraph tags produced an extra, empty paragraph.

This removes the paragraph tags around the `%2$s` placeholder.

Follow-up to [57545], [57714], [57769].

Props mukesh27.
Fixes #61546.
Built from https://develop.svn.wordpress.org/trunk@58616


git-svn-id: http://core.svn.wordpress.org/trunk@58049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-02 11:52:23 +00:00
Bernhard Reiter 31e6e2ce05 Block Hooks: Fix a number of multi-line comment openers.
Add the missing second asterisk to a number of multi-line comment openers, and remove a superfluous second asterisk from two others.

Follow-up to [58614].
Props mukesh27.
See #60854.
Built from https://develop.svn.wordpress.org/trunk@58615


git-svn-id: http://core.svn.wordpress.org/trunk@58048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-02 10:43:16 +00:00
Bernhard Reiter 73b9a4956f Block Hooks: Allow child insertion into Template Part block.
The Block Hooks mechanism was previously extended to allow insertion of a block as a Navigation block's first or last child. This was implemented by storing the `ignoredHookedBlocks` array in the corresponding `wp_navigation` post's post meta (instead of a metadata attribute on the anchor block).

This changeset extends that mechanism to Template Part blocks, by storing said metadata in the corresponding `wp_template_part` post's post meta, thus allowing extenders to use Block Hooks to insert a block as a Template Part block's first or last child, respectively.

Props tomjcafferkey, bernhard-reiter.
Fixes #60854.
Built from https://develop.svn.wordpress.org/trunk@58614


git-svn-id: http://core.svn.wordpress.org/trunk@58047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-02 10:03:15 +00:00
dmsnell df598e1d98 HTML API: Optimize low-level parsing details in Tag Processor.
Introduces a number of micro-level optimizations in the Tag Processor to
improve token-scanning performance. Should contain no functional changes.

Based on benchmarking against a list of the 100 most-visited websites,
these changes result in an average improvement in performance of the Tag
Processor for scanning tags from between 3.5% and 7.5%.

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

Follow-up to [55203].

See #61545.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-01 23:36:15 +00:00
Sergey Biryukov 8a4deae8f8 REST API: Correct image cropping tools in the block editor.
As of [58457], the width and height cropping values are cast to an integer before the comparison to see if the target width and height differ from the original width and height.

Since they are now integers, it exposes a bug where the `&&` of the `if` conditional meant that if you were only cropping in one dimension, the check wouldn't pass, and cropping would not occur.

In the block editor, the cropping tools are aspect ratio based, so one of the dimensions will always match that of the source image. Therefore, now that the values are cast as integers, the condition that allows a cropping to occur needs to be updated. If either width or height is different from the source image, then a crop should be allowed.

Follow-up to [50124], [58457].

Props andrewserong, jrf, kevin940726.
Fixes #61514. See #59782.
Built from https://develop.svn.wordpress.org/trunk@58612


git-svn-id: http://core.svn.wordpress.org/trunk@58045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-01 20:45:15 +00:00
Sergey Biryukov 4efbbb3415 Date/Time: Correct singular form for minutes in `human_time_diff()`.
Follow-up to [58600].

Props wildworks.
See #61535.
Built from https://develop.svn.wordpress.org/trunk@58601


git-svn-id: http://core.svn.wordpress.org/trunk@58044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-30 14:58:22 +00:00
Sergey Biryukov 5f22738264 Date/Time: Replace abbreviations for minutes in `human_time_diff()`.
This ensures that relative times are formatted the same way in both JS and PHP.

Follow-up to [1976], [2124], [4658], [41018], [56496].

Props wildworks.
Fixes #61535.
Built from https://develop.svn.wordpress.org/trunk@58600


git-svn-id: http://core.svn.wordpress.org/trunk@58043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-29 09:31:22 +00:00
desrosj 2548045917 Build/Test Tools: Allow older branches to use Coding Standards workflow.
This updates the reusable coding standards GitHub Actions workflow to support the old way of running PHPCS commands when the `old-branches` input flag is set to `true`. This allows the 5.1-5.4 branches to use the same workflow as all other 5.5+ branches.

See #61213.
Built from https://develop.svn.wordpress.org/trunk@58596


git-svn-id: http://core.svn.wordpress.org/trunk@58042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-28 18:21:11 +00:00
desrosj 211388b4b0 Build/Test Tools: Introduce two additional reusable PHPUnit workflows.
The changes associated with #61213 aim to update all branches potentially receiving security updates to use the same workflow files for easier maintenance as much as possible. However, there are times when the logic found in GitHub Action workflow files changes pretty drastically.

For PHPUnit testing, there are 2 instances where this occurred: the 5.2 and 5.9 branches. This changeset introduces 2 new reusable PHPUnit workflow files for use the 4.1-5.1 and 5.2-5.9 branches.

Including these workflows in `trunk` makes it more clear which version of the workflow file is used by these old branches, and allows Dependabot to open PRs for updating 3rd-party actions within these workflows.

Props jorbin.
See #61213.
Built from https://develop.svn.wordpress.org/trunk@58595


git-svn-id: http://core.svn.wordpress.org/trunk@58041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-28 18:18:17 +00:00
Sergey Biryukov f7f1739090 Tests: Use `assertSame()` in `WP_Interactivity_API` tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [57563], [57649], [57822], [57826], [57835], [58159], [58327].

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


git-svn-id: http://core.svn.wordpress.org/trunk@58040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-28 15:47:24 +00:00
gziolo 8545466f24 HTML API: Add tests for virtual node breadcrumbs and depth
Follow-up [58590].
See #61348.
Props jonsurrell, gziolo.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-28 09:22:17 +00:00
Pascal Birchler 98c48e4365 Docs: Fix docblock alignment for `pre_get_language_files_from_path` filter.
Props khokansardar.
Fixes #61416.
Built from https://develop.svn.wordpress.org/trunk@58591


git-svn-id: http://core.svn.wordpress.org/trunk@58038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-28 08:51:16 +00:00
Sergey Biryukov a47ccea2da Docs: Add missing full stop in some DocBlocks in `wp-includes/user.php`.
Follow-up to [40980], [43211], [43373], [47279], [51129].

Props praful2111, nareshbheda.
Fixes #61491.
Built from https://develop.svn.wordpress.org/trunk@58589


git-svn-id: http://core.svn.wordpress.org/trunk@58036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-27 23:17:17 +00:00
dmsnell ede77aca35 HTML API: Report breadcrumbs properly when visiting virtual nodes.
When [58304] introduced the abililty to visit virtual nodes in the HTML document,
those being the nodes which are implied by the HTML but no explicitly present in
the raw text, a bug was introduced in the `get_breadcrumbs()` method because it
wasn't updated to be aware of the virtual nodes. Therefore it would report the
wrong breadcrumbs for virtual nodes. Since the new `get_depth()` method is based
on the same logic it was also broken for virtual nodes.

In this patch, the breadcrumbs have been updated to account for the virtual nodes
and the depth method has been updated to rely on the fixed breadcrumb logic.

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

Follow-up to [58304].

Props dmsnell, jonsurrell, zieladam.
See #61348.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-27 20:49:19 +00:00
desrosj c1d1be9745 Build/Test Tools: Revert `uglify-js` update.
This partially reverts [58563], which applied an update of the `uglify-js` `devDependency` from `3.17.4` to `3.18.0`.

The `3.18.0` update is causing some JavaScript errors in the `media-views.min.js` file, so needs to be investigated further.

Props david.binda, mukesh27, alshakero.
Fies #61519.
Built from https://develop.svn.wordpress.org/trunk@58585


git-svn-id: http://core.svn.wordpress.org/trunk@58032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-27 12:55:22 +00:00
Tammie Lister da76e67830 Twenty Seventeen: Fixes button block font weight not changing.
The button block appearance was not changing when using settings. This resolves that using inherit.

Props pranitdugad, sabernhardt, shailu25, hmbashar.
Fixes #60937.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-26 21:07:22 +00:00
Tammie Lister 8b20dd4294 Twenty Twenty-One: Resolves wrong drop cap alignment in RTL.
Drop cap was not aligning correct for RTL. This removes the float property.

Props rafaelgalani, peterwilsoncc, ryancurban, sabernhardt.
Fixes #52885.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-26 19:58:15 +00:00
Tammie Lister 43126fa789 Twenty Nineteen: Fixes messy navigation with RTL language.
The first tag wasn't switching correctly. This resolves it for an adjacent RTL language link setting list items to inline-block.

Props manooweb, audrasjb, SergeyBiryukov, davidbaumwald, marybaum, sabernhardt.
Fixes #46658.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-26 19:13:15 +00:00
Sergey Biryukov c15614f3cb Users: Restore spacing between the messages on Edit User screen.
Includes restoring paragraph tags for “User updated” and “← Go to Users” messages, so that the arrow is not on the same line as the previous message.

Follow-up to [56570].

Props Presskopp, narenin, swissspidy, SergeyBiryukov.
Fixes #61506.
Built from https://develop.svn.wordpress.org/trunk@58581


git-svn-id: http://core.svn.wordpress.org/trunk@58028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-26 15:23:14 +00:00
Tammie Lister 13d010f2d6 Twenty Nineteen: Fixes avatar block size inconsistency.
The avatar block size was different between front and editor. This was because the width and height were added to the avatar class. 

Props poena, naeemhaque, sabernhardt, sakibmd.
Fixes #60664.

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


git-svn-id: http://core.svn.wordpress.org/trunk@58027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-26 13:48:13 +00:00
Bernhard Reiter 3c520f16dd Script Modules: Add new API to embed server data in HTML.
Add a new filter `script_module_data_{$module_id}` to associate data
with a Script Module. For example:

{{{#!php
add_filter(
	'script_module_data_MyScriptModuleID',
	function ( array $data ): array {
		$data['script-needs-this-data'] = 'ok';
		return $data;
	}
);
}}}

If the Script Module is included in the page, enqueued or as a
dependency, the associated data will be JSON-encoded and embedded in the
HTML in a `<script type="application/json">` tag with an ID of the form
`wp-script-module-data-{$module_id}` allowing the Script Module to
access the data on the client.

See the original proposal: https://make.wordpress.org/core/2024/05/06/proposal-server-to-client-data-sharing-for-script-modules/

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

Props jonsurrell, cbravobernal, westonruter, gziolo, bernhard-reiter, youknowriad, sergiomdgomes, czapla.
Fixes #61510. See #60647.
Built from https://develop.svn.wordpress.org/trunk@58579


git-svn-id: http://core.svn.wordpress.org/trunk@58026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-26 13:21:17 +00:00
Bernhard Reiter 3f2b674b36 Block Hooks: Refactor controller filter to use meta_input.
Prior to this changeset, the function `update_ignored_hooked_blocks_postmeta()` used the core function `update_post_meta()` to write `_wp_ignored_hooked_blocks` data to the database during an operation that is preparing a post to be inserted.

Since we have access to the incoming changes that are being prepared we can remove this database operation in favour of writing the data to the post object provided under `meta_input`.

Doing this means two things:

1. It allows us to store postmeta for new posts that are about to be created since they don't have an `ID` yet (which is information `update_post_meta()` needs).
2. The core controller will take care of updating postmeta in a more predictable pattern.

Props tomjcafferkey, bernhard-reiter.
Fixes #61495.
Built from https://develop.svn.wordpress.org/trunk@58578


git-svn-id: http://core.svn.wordpress.org/trunk@58025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-26 08:54:13 +00:00
gziolo 0c56c3f7dd Build: Remove legacy webpack DefinePlugin configuration
Follow-up [58193].
Fixes #61262.
Props jonsurrell.


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


git-svn-id: http://core.svn.wordpress.org/trunk@58024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-26 08:27:17 +00:00
Peter Wilson 7b1dd8d942 Set trunk version global to 6.7-alpha rather than RC1.
Follow up to [58575].

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


git-svn-id: http://core.svn.wordpress.org/trunk@58023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-06-25 23:10:23 +00:00