Commit Graph

36068 Commits

Author SHA1 Message Date
dmsnell
050c342a46 HTML API: Add support for BR, EMBED, & other tags.
Adds support for the following HTML elements to the HTML Processor:

 - AREA, BR, EMBED, KEYGEN, WBR
 - Only the opening BR tag is supported, as the invalid closer `</br>`
   involves more complicated rules, to be implemented later.

Previously, these elements were not supported and the HTML Processor
would bail when encountering them. With this patch it will proceed to
parse an HTML document when encountering those tags as long as other
normal conditions don't cause it to bail (such as complicated format
reconstruction rules).

Props jonsurrell, dmsnell
Fixes #60283


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


git-svn-id: http://core.svn.wordpress.org/trunk@56822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-19 21:41:12 +00:00
Joe McGill
5d2bccd66d Editor: Support deferred block variation initialization on the server.
When registering blocks on the server using `register_block_type()` or similar functions, a set of block type variations can also be registered. However, in some cases building this variation data during block registration can be an expensive process, which is not needed in most contexts. 

To address this problem, this adds support to the `WP_Block_Type` object for a new property, `variation_callback`, which can be used to register a callback for building variation data only when the block variations data is needed. The `WP_Block_Type::variations` property has been changed to a private property that is now accessed through the magic `__get()` method. The magic getter makes use of a new public method, `WP_Block_Type::get_variations` which will build variations from a registered callback if variations have not already been built.

Props spacedmonkey, thekt12, Mamaduka, gaambo, gziolo, mukesh27, joemcgill.
Fixes #59969.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-19 20:54:13 +00:00
dmsnell
141ba4ff59 HTML API: Add support for HR element.
Adds support for the following HTML elements to the HTML Processor:

 - HR

Previously, this element was not supported and the HTML Processor would bail when encountering
it. Now, with this patch, it will proceed to parse an HTML document when encountering one.

Developed in WordPress/wordpress-develop#5897

Props jonsurrell, dmsnell
Fixes #60283


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


git-svn-id: http://core.svn.wordpress.org/trunk@56820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-19 19:03:09 +00:00
Sergey Biryukov
64a499ab92 Twenty Twenty: Add missing comma in twentytwenty_classic_editor_styles().
This resolves a WPCS error:
{{{
There should be a comma after the last array item in a multi-line array.
}}}

Follow-up to [57311].

See #48630.
Built from https://develop.svn.wordpress.org/trunk@57313


git-svn-id: http://core.svn.wordpress.org/trunk@56819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-19 18:26:11 +00:00
Felix Arntz
e19c18cba9 Bootstrap/Load: Introduce functions to check whether WordPress is serving a REST API request.
This changeset introduces two functions:
* `wp_is_serving_rest_request()` returns a boolean for whether WordPress is serving an actual REST API request.
* `wp_is_rest_endpoint()` returns a boolean for whether a WordPress REST API endpoint is currently being used. While this is always the case if `wp_is_serving_rest_request()` returns `true`, the function additionally covers the scenario of internal REST API requests, i.e. where WordPress calls a REST API endpoint within the same request.

Both functions should only be used after the `parse_request` action.

All relevant manual checks have been adjusted to use one of the new functions, depending on the use-case. They were all using the same constant check so far, while in fact some of them were intending to check for an actual REST API request while others were intending to check for REST endpoint usage.

A new filter `wp_is_rest_endpoint` can be used to alter the return value of the `wp_is_rest_endpoint()` function.

Props lots.0.logs, TimothyBlynJacobs, flixos90, joehoyle, peterwilsoncc, swissspidy, SergeyBiryukov, pento, mikejolley, iandunn, hellofromTonya, Cybr, petitphp.
Fixes #42061.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-19 17:40:09 +00:00
Sergey Biryukov
9d8b474654 Twenty Twenty: Move the Inter font declaration to a separate file and enqueue the file.
This allows the font to be dequeued by a child theme or plugin.

Props poena, markhowellsmead, nielslange, Otto42, SGr33n, mukesh27, joemcgill.
Fixes #48630.
Built from https://develop.svn.wordpress.org/trunk@57311


git-svn-id: http://core.svn.wordpress.org/trunk@56817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-19 17:38:14 +00:00
Peter Wilson
3a36e92c88 Media: Redirect inactive attachement pages for logged-out users.
Ensure logged out users are redirected to the media file when attachment pages are inactive. This removes the `read_post` capability check from the canonical redirects as anonymous users lack the permission.

Follow-up to [56657], [56658], [56711].

Props afercia, aristath, chesio, joppuyo, jorbin, lakshmananphp, poena, sergeybiryukov.
Fixes #59866.
See #57913.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-19 00:44:13 +00:00
Sergey Biryukov
a6c37e6b50 Docs: Fix several typos in inline comments.
Follow-up to [7747], [27419], [55155].

Props shailu25, sabernhardt.
Fixes #60285.
Built from https://develop.svn.wordpress.org/trunk@57309


git-svn-id: http://core.svn.wordpress.org/trunk@56815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-18 22:13:16 +00:00
Felix Arntz
0e4eaa64b5 Build/Test Tools: Fix unstable query tests.
Three `WP_Query` tests could randomly fail due to an undefined order because two test posts were using the exact same `post_date`.

Props boonebgorges, flixos90.
Fixes #60288.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-18 18:40:13 +00:00
Aaron Jorbin
f4b5da2859 Embeds: Ensure the deprecated function print_emoji_styles isn't used
Ensure that the proper new function wp_enqueue_emoji_styles is used in embeds.

Follow-up to: [56194].

Props peterwilsoncc, bobbingwide, hellofromTonya.
Fixes #59892. See: #58775.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-17 21:36:16 +00:00
Pascal Birchler
e09d2034a6 I18N: Fix duplicate determine_locale() tests added in [57286].
Props johnbillion.
See #58696.
Built from https://develop.svn.wordpress.org/trunk@57305


git-svn-id: http://core.svn.wordpress.org/trunk@56811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-17 18:56:12 +00:00
Sergey Biryukov
2ba732f956 Twenty Twenty-Four: Remove extra tab character inside the text domain.
Follow-up to [57281].

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


git-svn-id: http://core.svn.wordpress.org/trunk@56810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-17 18:00:16 +00:00
Pascal Birchler
e6a10d45e7 I18N: Prevent PHP warning in WP_Textdomain_Registry.
Prevents a warning upon cache invalidation after language pack updates if the arguments don’t have the expected format.

Follow-up to [57287], [57290], [57298], [57299].

See #58919.
Built from https://develop.svn.wordpress.org/trunk@57303


git-svn-id: http://core.svn.wordpress.org/trunk@56809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-17 14:32:18 +00:00
audrasjb
b9638e6b00 Docs: Fix var types of parameters in sanitize_option() and sanitize_option_{$option}.
The related docblocks were previously defining `$value` and `$original_value` as if they were of type `string`, but they can also be of other types, like `array`.

Props gerardreches, crstauf, mukesh27.
Fixes #60214.
See #59651.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-17 09:09:15 +00:00
audrasjb
79e39943a5 Twenty Twenty: Replace wp_date() with date_i18n().
Since WordPress 5.3 it is recommended to use `wp_date()` instead of `date_i18n()`. This changeset replaces the function in Twenty Twenty, with a fallback to `date_i18n()` for old versions of WordPress.

For more info, see https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/.

Props sachyya-sachet, joyously, sabernhardt, poena.
Fixes #48589.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-17 09:01:16 +00:00
audrasjb
1866ae2cb3 Bundled Themes: Typo corrections in various themes docblocks.
Props shailu25.
Fixes #60268.
See #59651.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-17 08:53:15 +00:00
Sergey Biryukov
0a0b0e91cf I18N: Correctly invalidate language file paths in WP_Textdomain_Registry.
Since the cache key in `::get_language_files_from_path()` is based on a path that always includes a trailing slash, the path in `::invalidate_mo_files_cache()` should include the trailing slash as well.

Includes adjusting the test expectations accordingly.

Follow-up to [57287], [57290], [57298].

See #58919.
Built from https://develop.svn.wordpress.org/trunk@57299


git-svn-id: http://core.svn.wordpress.org/trunk@56805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-16 21:45:12 +00:00
Sergey Biryukov
fb3b7f59e3 Tests: Remove leftover trailingslashit() calls in WP_Textdomain_Registry tests.
Follow-up to [57287], [57290].

See #58919.
Built from https://develop.svn.wordpress.org/trunk@57298


git-svn-id: http://core.svn.wordpress.org/trunk@56804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-16 21:34:16 +00:00
desrosj
d76e220659 Bundled Themes: Version bump themes affected by #60241.
In order to release the fix for #60241, this bumps the version of the following themes:
- Twenty Seventeen: 3.5
- Twenty Twenty: 2.5
- Twenty Twenty-One: 2.2

Props sabernhardt, jorbin.
See #60267.
Built from https://develop.svn.wordpress.org/trunk@57296


git-svn-id: http://core.svn.wordpress.org/trunk@56802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-16 19:25:12 +00:00
joedolson
cb1e71aa25 Administration: Remove empty form action attributes.
Remove the `action` attribute in the login language selector, privacy forms, and classic widget forms.

An empty `action` attribute is invalid HTML4 and unsupported HTML5. The `action` attribute is optional, but must have a valid URL when provided.

Props Malae, audrasjb, bartkleinreesink, nicolefurlan, shubhamsedani, costdev, peterwilsoncc, rajinsharwar, joedolson.
Fixes #58226.
Built from https://develop.svn.wordpress.org/trunk@57295


git-svn-id: http://core.svn.wordpress.org/trunk@56801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-16 17:31:13 +00:00
Felix Arntz
14263ea394 Media: Consider inline image CSS width to backfill width and height attributes.
Prior to this changeset, WordPress core would use the original image size, which in the particular case of inline images would be severely off, as they are usually very small. This could lead to incorrect application of `fetchpriority="high"` and other performance optimizations.

Props westonruter, flixos90, joemcgill, mukesh27.
Fixes #59352.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-16 17:03:13 +00:00
Pascal Birchler
365a82ffeb I18N: Do not use trailingslashit in WP_Textdomain_Registry.
This usage of `trailingslashit()`, introduced in [57287], is not only redundant, but also discouraged in order to avoid `formatting.php` dependency (which might not always be loaded).

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


git-svn-id: http://core.svn.wordpress.org/trunk@56796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-16 12:12:17 +00:00
Peter Wilson
2590eeb14c Docs: Format new_admin_email_content placeholders as a list.
Format the email placeholders for the `new_admin_email_content` hook as a list for clarity and to avoid parsing errors in docblock consumers.

Props dd32, shooper, stevenlinx.
Fixes #60262.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-16 04:06:18 +00:00
Pascal Birchler
4d37fc7865 I18N: Cache list of language file paths in WP_Textdomain_Registry.
Loading a list of language file paths using `glob()` can be expensive if involving thousands of files.

Expands scope of `WP_Textdomain_Registry` to cache list of language file paths in object cache and provides a way to invalidate that cache upon translation updates. Plugins can clear the cache using calls such as `wp_cache_delete( 'cached_mo_files_' . md5( $path ), 'translations' );`

Props mreishus, swissspidy
Fixes #58919
Built from https://develop.svn.wordpress.org/trunk@57287


git-svn-id: http://core.svn.wordpress.org/trunk@56793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-15 19:05:14 +00:00
Pascal Birchler
b713c5eb9c Upgrade/Install: Fix JavaScript localization on install page.
Blocks registration causes scripts to be initialized and localized very early, before the current locale has been properly set on the installation page.

This changes `determine_locale()` so that the locale chosen during installation is recognized and loaded earlier, ensuring proper script localization.

Props sabernhardt, NekoJonez, jornp, costdev.
Fixes #58696
Built from https://develop.svn.wordpress.org/trunk@57286


git-svn-id: http://core.svn.wordpress.org/trunk@56792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-15 18:57:14 +00:00
Sergey Biryukov
50670cd102 Comments: Use post_password_required() for comment capability checks.
Follow-up to [56836], [57123].

Fixes #59929.
Built from https://develop.svn.wordpress.org/trunk@57285


git-svn-id: http://core.svn.wordpress.org/trunk@56791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-15 17:42:18 +00:00
Sergey Biryukov
368e2fc5cd Tests: Move wp_parse_list() tests to their own file.
This aims to make the tests more discoverable and easier to expand.

Follow-up to [44546].

See #59647.
Built from https://develop.svn.wordpress.org/trunk@57284


git-svn-id: http://core.svn.wordpress.org/trunk@56790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-14 17:17:15 +00:00
audrasjb
f16bd4cac4 Administration: Introduce new_admin_email_subject filter.
This changeset introduces the `new_admin_email_subject` hook which allow developers to filter the subject of the email sent when a change of site admin email address is attempted.

Props MadtownLems, johnbillion, alexanderkoledov, shooper, Marc_J, nikmeyer, xlthlx, devmuhib, nuhel, audrasjb.
Fixes #59250.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-14 11:01:17 +00:00
audrasjb
4d2c122564 Twenty Seventeen: Fix wrong text-domain introduced in [57281].
Follow-up to [57281].

Unprops audrasjb.
See #60245.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-14 10:48:09 +00:00
audrasjb
7502811c88 Bundled Themes: Add missing text domain to various block patterns.
This changeset adds missing text domain to block patterns in Twenty Sixteen, Twenty Seventeen and Twenty Twenty-Four.

Follow-up to [49583] (Twenty Sixteen), [49584] (Twenty Seventeen) and [56716] (Twenty Twenty-Four.)

Props shailu25, sabernhardt.
Fixes #60245.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-14 10:44:14 +00:00
audrasjb
b6d3cb0838 Docs: Fix wrong inline comment in delete_theme().
Props wildworks.
Fixes #60246.
See #59651.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-14 10:06:18 +00:00
audrasjb
855c1b55d6 Docs: Improve wp_admin_notice() function docblock.
This changeset adds a description for the `attributes` key of `$args` in `wp_admin_notice()`.

Props tmatsuur.
Fixes #59887.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-14 08:42:19 +00:00
Sergey Biryukov
41fe45ced7 Tests: Correct the @group annotation in some tests.
Follow-up to [56971], [57146].

See #59647.
Built from https://develop.svn.wordpress.org/trunk@57278


git-svn-id: http://core.svn.wordpress.org/trunk@56784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-13 16:33:18 +00:00
Sergey Biryukov
32bd6d1a8e Twenty Twenty-One: Revert usage of str_contains() in theme files.
The theme supports WordPress 5.3 or later, while the polyfill for `str_contains()` only exists in WordPress 5.9 or later.

Follow-up to [55988], [57275], [57276].

Props poena.
Fixes #60241.
Built from https://develop.svn.wordpress.org/trunk@57277


git-svn-id: http://core.svn.wordpress.org/trunk@56783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-12 19:16:07 +00:00
Sergey Biryukov
93a75784b7 Twenty Twenty: Revert usage of str_contains() in theme files.
The theme supports WordPress 4.7 or later, while the polyfill for `str_contains()` only exists in WordPress 5.9 or later.

Follow-up to [55988], [57275].

Props poena.
See #60241.
Built from https://develop.svn.wordpress.org/trunk@57276


git-svn-id: http://core.svn.wordpress.org/trunk@56782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-12 19:14:08 +00:00
Sergey Biryukov
91004791b9 Twenty Seventeen: Revert usage of str_contains() in theme files.
The theme supports WordPress 4.7 or later, while the polyfill for `str_contains()` only exists in WordPress 5.9 or later.

Follow-up to [55988].

Props poena.
See #60241.
Built from https://develop.svn.wordpress.org/trunk@57275


git-svn-id: http://core.svn.wordpress.org/trunk@56781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-12 19:12:14 +00:00
joedolson
9ddc1f9761 Users: Remove periods in checkbox labels for consistency.
Remove periods at the ends of three checkbox labels on add new user screen.

Checkboxes in the WordPress admin generally do not have periods.

Props pratikthink, joedolson.
Fixes #43814.
Built from https://develop.svn.wordpress.org/trunk@57274


git-svn-id: http://core.svn.wordpress.org/trunk@56780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-12 17:14:14 +00:00
joedolson
ea9bf63acc Media: Fix inaccurate docs for wp_attachment_is().
Correct the documentation for the `$type` parameter to accept file extensions as well as attachment type groups. Also fix the return description to reflect the change.

Props nirav7707, joedolson.
Fixes #59698.
Built from https://develop.svn.wordpress.org/trunk@57273


git-svn-id: http://core.svn.wordpress.org/trunk@56779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-12 16:49:16 +00:00
joedolson
1ee473633a Administration: Remove invalid attribute maxlength on number input.
Remove the `maxlength` attribute on screen options number of items per page input. Previously kept due to input inconsistencies in IE 11 and Edge, this invalid usage is no longer needed. IE 11 is no longer supported, and Edge now behaves according to specifications.

Props Arena94, afercia, joedolson.
Fixes #40610.
Built from https://develop.svn.wordpress.org/trunk@57272


git-svn-id: http://core.svn.wordpress.org/trunk@56778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-11 17:44:12 +00:00
Bernhard Reiter
ffcd954ef8 Modules API: Fix indentation.
Follow-up [57269].

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


git-svn-id: http://core.svn.wordpress.org/trunk@56777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-11 15:53:22 +00:00
Andrea Fercia
48a4a51b91 Administration: Accessibility: Improve color contrast of the Copy buttons success message.
Props sabernhardt.
Fixes #60140.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-11 15:52:14 +00:00
Bernhard Reiter
36f543f447 JavaScript: Add new Modules API.
This changeset adds a new API for WordPress, designed to work with native ES Modules and Import Maps. It introduces functions such as `wp_register_module`, and `wp_enqueue_module`.

The API aims to provide a familiar experience to the existing `WP_Scripts` class, offering similar functionality. However, **it's not intended to duplicate the exact functionality of `WP_Scripts`**; rather, it is carefully tailored to address the specific needs and capabilities of ES modules.

For this initial version, **the current proposal is intentionally simplistic**, covering only the essential features needed to work with ES modules. Other enhancements and optimizations can be added later as the community identifies additional requirements and use cases.

== Differences Between WP_Script_Modules and WP_Scripts

=== Dependency Specification

With `WP_Script_Modules`, the array of dependencies supports not only strings but also arrays that include the dependency import type (`static` or `dynamic`). This design choice allows for future extensions of dependency properties, such as adding a `version` property to support "scopes" within import maps.

=== Module Identifier

Instead of a handle, `WP_Script_Modules` utilizes the module identifier, aligning with the module identifiers used in JavaScript files and import maps.

=== Deregistration

There is no equivalent of `wp_deregister_script` at this stage.

== API

=== `wp_register_module( $module_identifier, $src, $deps, $version )`

Registers a module.

{{{
// Registers a module with dependencies and versioning.
wp_register_module(
  'my-module',
  '/path/to/my-module.js',
  array( 'static-dependency-1', 'static-dependency-2' ),
  '1.2.3'
);
}}}

{{{
// my-module.js
import { ... } from 'static-dependency-1';
import { ... } from 'static-dependency-2';

// ...
}}}

{{{
// Registers a module with a dynamic dependency.
wp_register_module(
  'my-module',
  '/path/to/my-module.js',
  array(
    'static-dependency',
    array(
      'id'     => 'dynamic-dependency',
      'import' => 'dynamic'
    ),
  )
);
}}}

{{{
// my-module.js
import { ... } from 'static-dependency';

// ...
const dynamicModule = await import('dynamic-dependency');
}}}

=== `wp_enqueue_module( $module_identifier, $src, $deps, $version )`

Enqueues a module. If a source is provided, it will also register the module.

{{{
wp_enqueue_module( 'my-module' );
}}}

=== `wp_dequeue_module( $module_identifier )`

Dequeues a module.

{{{
wp_dequeue_module( 'my-module' );
}}}

== Output

- When modules are enqueued, they are printed within script tags containing `type="module"` attributes.
- Additionally, static dependencies of enqueued modules utilize `link` tags with `rel="modulepreload"` attributes.
- Lastly, an import map is generated and inserted using a `<script type="importmap">` tag.

{{{
<script type="module" src="/path/to/my-module.js" id="my-module"></script>
<link rel="modulepreload" href="/path/to/static-dependency.js" id="static-dependency" />
<script type="importmap">
  {
    "imports": {
      "static-dependency": "/path/to/static-dependency.js",
      "dynamic-dependency": "/path/to/dynamic-dependency.js"
    }
  }
</script>
}}}

== Import Map Polyfill Requirement

Even though all major browsers already support import maps, an import map polyfill is required until the percentage of users using old browser versions without import map support drops significantly.

This work is ongoing and will be added once it's ready. Progress is tracked in #60232.

Props luisherranz, idad5, costdev, neffff, joemcgill, jorbin, swissspidy, jonsurrell, flixos90, gziolo, westonruter.
Fixes #56313.
Built from https://develop.svn.wordpress.org/trunk@57269


git-svn-id: http://core.svn.wordpress.org/trunk@56775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-11 14:47:14 +00:00
Sergey Biryukov
c9291ac596 Tests: Remove some leftover debugging in WP_REST_Revisions_Controller tests.
Follow-up to [57222].

See #59875.
Built from https://develop.svn.wordpress.org/trunk@57268


git-svn-id: http://core.svn.wordpress.org/trunk@56774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-11 13:18:17 +00:00
joedolson
bcb0f74678 Media: Fix handling of multibyte exif description metadata.
The exif standards expect the UserComment field to be used as a substitute for ImageDescription if multibyte characters are needed. WordPress media only mapped the ImageDescription field and did not correctly handle descriptions with multibyte characters.

Fix metadata saving to better handle media with multibyte characters in metadata and update unit tests.

Props fotodrachen, antpb, joedolson, mikinc860, azaozz, nicolefurlan.
Fixes #58082.
Built from https://develop.svn.wordpress.org/trunk@57267


git-svn-id: http://core.svn.wordpress.org/trunk@56773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-10 21:59:13 +00:00
joedolson
1d2e7fd49d Tests: Fix tests following r57265.
Update unit tests failing after r57265 changed strings in single post template descriptions. Follow up to [57265].

Props joedolson.
Fixes #60216.
Built from https://develop.svn.wordpress.org/trunk@57266


git-svn-id: http://core.svn.wordpress.org/trunk@56772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-10 21:14:16 +00:00
Sergey Biryukov
39f7f558d9 Editor: Clarify single post and page template descriptions.
Follow-up to [55500].

Props mikachan.
Fixes #60216.
Built from https://develop.svn.wordpress.org/trunk@57265


git-svn-id: http://core.svn.wordpress.org/trunk@56771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-10 17:08:11 +00:00
dmsnell
29dd837333 HTML API: Add support for list elements.
Adds support for the following HTML elements to the HTML Processor:

 - LI, OL, UL.
 - DD, DL, DT.

Previously, these elements were not supported and the HTML Processor would bail when encountering them.
With this patch it will proceed to parse an HTML document when encountering those tags as long as other normal conditions don't cause it to bail (such as complicated format reconstruction).

Props audrasjb, jonsurrell, bernhard-reiter.
Fixes #60215.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-10 14:05:17 +00:00
costdev
28331b7aae Docs: Correct some typos in docblocks and inline comments.
This corrects several typos in documentation, including:
- "imput" -> "input"
- "proessing" -> "processing"
- "instantating" -> "instantiating"
- "filtersing" -> "filtering"
- "officaly" -> "officially"

Follow-up to [8852], [25307], [26191], [37488], [54416].

Props benniledl, mukesh27, jayadevankbh, Presskopp.
Fixes #60069. See #59651.
Built from https://develop.svn.wordpress.org/trunk@57263


git-svn-id: http://core.svn.wordpress.org/trunk@56769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-10 11:57:15 +00:00
costdev
cee1cd2789 Customize: Correct a typo in a console warning message.
This corrects a typo from "instantating" to "instantiating".

Follow-up to [41374].

Props benniledl, mukesh27, Presskopp.
Fixes #60222.
Built from https://develop.svn.wordpress.org/trunk@57262


git-svn-id: http://core.svn.wordpress.org/trunk@56768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-10 11:13:19 +00:00
isabel_brison
f2e220ffa2 Editor: fix inline comment formatting.
Correctly formats inline comment in `wp_get_global_stylesheet`.

Follow-up to [57259].

Props mukesh27.
See #60134.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-10 04:09:18 +00:00
isabel_brison
2588f90ab2 Editor: Allow default duotone styles if not explicitly disabled in theme.json.
Removes setting that disabled default duotone palette from being output in themes without theme.json.

Props andrewserong.
Fixes #60136.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-10 00:27:15 +00:00
isabel_brison
c8dc74b0bc Editor: output palette presets when appearance tools or border are enabled.
Adds color palette presets to global styles output if current theme supports either appearance tools or border.

Props andrewserong, noisysocks.
Fixes #60134.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-09 23:32:12 +00:00
Aaron Jorbin
c4c8ae426d Editor: update npm packages in trunk for 6.4.3.
Package Update includes fixes for:
- Image Block: Enable image block to be selected correctly when clicked.
- Reduce specificity of default Cover text color styles.
- Image Block: Fix deprecation when width/height attribute is number.
- Text selection: show CSS hack to Safari only.
- SlotFill: Allow contextual SlotFillProviders.

See: https://github.com/WordPress/wordpress-develop/pull/5696
See: bd6767b8a4
See: https://github.com/WordPress/gutenberg/pull/56043
See: https://github.com/WordPress/gutenberg/pull/56411
See: https://github.com/WordPress/gutenberg/pull/57063
See: https://github.com/WordPress/gutenberg/pull/57300
See: https://github.com/WordPress/gutenberg/pull/56779

Props mikachan, wildworks, alexstine, poena, isabel_brison, andrewserong, czapla, andraganescu, joen, ellatrix, youknowriad, ntsekouras.
Fixes #59943, #59943.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-09 20:17:30 +00:00
hellofromTonya
178deab664 Tests: Add hook priority call order tests.
Adds happy (integer) and unhappy (non-integer) tests for validating the priority call order for:

* `do_action()`
* `WP_Hook::do_action()`
* `apply_filters()`
* `WP_Hook::apply_filters()`

As each of these functions have differing code, the tests are added to each to ensure expected results and protect against future regressions.

Follow-up to [53804], [52010], [25002], [25/tests], [62/tests].

Props hellofromTonya, mukesh27, dd32, valendesigns, drrobotnik.
Fixes #60193.
Built from https://develop.svn.wordpress.org/trunk@57257


git-svn-id: http://core.svn.wordpress.org/trunk@56763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-09 16:34:17 +00:00
Sergey Biryukov
26099a407d Docs: Add a mention of appearance-tools as a possible value for add_theme_support().
Follow-up to [57255].

See #60118.
Built from https://develop.svn.wordpress.org/trunk@57256


git-svn-id: http://core.svn.wordpress.org/trunk@56762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-09 11:41:18 +00:00
isabel_brison
b0b64739ff Themes: Add theme support for appearance tools.
Reapplies the patch reverted in #57649 as the original patch was no longer applying cleanly. Adds theme support for appearance tools to `WP_Theme_JSON_Resolver`.

Props andrewserong, mukesh27, noisysocks.
Fixes #60118.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-09 06:26:16 +00:00
isabel_brison
90088c4c92 Editor: add size and repeat to background image support.
Adds background size and background repeat style processing to the background image block support and `WP_Style_Engine` definitions.

Props andrewserong, mukesh27.
Fixes #60175.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-09 06:12:18 +00:00
isabel_brison
6e67ad1701 Editor: add CSS var parsing for fontSize and fontFamily.
Adds capability to parse CSS custom properties for fontSize and fontFamily in `WP_Style_Engine`.

Props ramonopoly.
Fixes #59982.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-09 02:45:16 +00:00
Aaron Jorbin
c59c7d90c4 Upgrade/Install: Check theme compatibility during bulk upgrades.
Previously, bulk upgrades did not verify that a theme package was compatible with the site's WordPress version or the server's PHP version.

This was previusly done for plugins in #59198, but themes were missed.

Follow-up to: [56525].

Props salcode, lakshmananphp.
Fixes #59758.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-08 23:19:16 +00:00
Sergey Biryukov
a38245a657 Taxonomy: Check for empty term after DB sanitization in wp_insert_term().
When inserting a new term in the database, `wp_insert_term()` will check if the term is empty and return a corresponding error.

Afterwards the term is sanitized and inserted in the database. However, there is a chance the term is empty after the DB sanitization.

This commit adds a check for an empty term name after the term is sanitized, returning an error in that case.

Follow-up to [5726], [8393].

Props fgiannar, kraftbj.
Fixes #59995.
Built from https://develop.svn.wordpress.org/trunk@57251


git-svn-id: http://core.svn.wordpress.org/trunk@56757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-08 22:44:17 +00:00
desrosj
854f43fdac Build/Test Tools: Increase the max old space size in Node.
The Test Build Processes workflow started failing recently on MacOS runners due to “JavaScript heap out of memory” errors (see https://github.com/WordPress/wordpress-develop/actions/runs/7421385568/job/20209241826#step:8:82).

This increases the maximum memory size of the old memory section in Node from the default of 4GB to 8GB (specified in megabytes) to avoid unnecessary failures while ways to optimize the Gutenberg build process are explored.

Props dmsnell, joemcgill, hellofromTonya, isabel_brison.
See #59805.
Built from https://develop.svn.wordpress.org/trunk@57250


git-svn-id: http://core.svn.wordpress.org/trunk@56756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-08 18:38:22 +00:00
desrosj
af166c4d98 Build/Test Tools: Remove svn debug command.
SVN support has officially been sunset by GitHub. While SVN was not has not been utilized in GitHub Action workflows, the version of SVN being used has been output for debugging purposes.

This removes those debug lines to prevent encountering failures as new versions of test runners are pushed out without `svn` installed.

See https://github.blog/changelog/2024-01-08-subversion-has-been-sunset/.

See #59805.
Built from https://develop.svn.wordpress.org/trunk@57249


git-svn-id: http://core.svn.wordpress.org/trunk@56755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-08 15:51:26 +00:00
Bernhard Reiter
372e3c4b97 HTML API: Add explicit handling or failure for all tags.
The HTML API HTML processor does not yet support all tags. Many tags (e.g. list elements) have some complicated rules in the [https://html.spec.whatwg.org/#parsing-main-inbody "in body" insertion mode].

Implementing these special rules is blocking the implementation for a catch-all rule for "any other tag" because we need to prevent special rules from being handled by the catch-all.

  Any other start tag
  Reconstruct the active formatting elements, if any.

  Insert an HTML element for the token.

  …

This change ensures the HTML Processor fails when handling special tags. This is the same as existing behavior, but will allow us to implement the catch-all "any other tag" handling without unintentionally handling special elements.

Additionally, we add tests that assert the special elements are unhandled. As these tags are implemented, this should help to ensure they're removed from the unsupported tag list.

Props jonsurrell, dmsnell.
Fixes #60092.
Built from https://develop.svn.wordpress.org/trunk@57248


git-svn-id: http://core.svn.wordpress.org/trunk@56754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-08 14:05:24 +00:00
isabel_brison
d966a9f046 Editor: add setting to disable layout content and wide size controls.
Adds support for an `allowCustomContentAndWideSize` setting in `WP_Theme_JSON` valid settings.

Props andrewserong.
Fixes #60133.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-08 06:23:14 +00:00
isabel_brison
2b005a61ef Editor: add layout classes to legacy Group inner container.
Moves generated layout classes into the Group block inner container in classic themes, so that block gap support can work correctly.

Props flixos90, mukesh27.
Fixes #60130.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-08 06:13:20 +00:00
Sergey Biryukov
45df401868 Site Health: Include site ID in debug data on multisite installations.
Follow-up to [44986].

Props sebastienserre, mukesh27.
Fixes #60081.
Built from https://develop.svn.wordpress.org/trunk@57245


git-svn-id: http://core.svn.wordpress.org/trunk@56751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-07 16:09:21 +00:00
Sergey Biryukov
7670c25979 Tests: Use assertSame() in some newly introduced 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 [55859], [56380], [56802], [57115], [57129], [57185].

See #59655.
Built from https://develop.svn.wordpress.org/trunk@57244


git-svn-id: http://core.svn.wordpress.org/trunk@56750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-06 13:01:20 +00:00
costdev
f86599ded1 Docs: Fix typo in twentyten_header_image_height filter's docblock.
This corrects a minor typo from "defaul" to "default" in the docblock of the `twentyten_header_image_height` filter.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-06 09:47:24 +00:00
Sergey Biryukov
9398968765 Tests: Add a @ticket reference for WP_Customize_Manager::trash_changeset_post() test.
Follow-up to [56043], [57238], [57241].

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


git-svn-id: http://core.svn.wordpress.org/trunk@56748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-05 11:40:20 +00:00
Sergey Biryukov
e864ae4450 Tests: Add a unit test for post trash hooks executed when trashing a changeset.
The test ensures that the correct number of arguments is passed to post trash hooks in `WP_Customize_Manager::trash_changeset_post()`, which bypasses `wp_trash_post()`.

Follow-up to [56043], [57238].

See #60183.
Built from https://develop.svn.wordpress.org/trunk@57241


git-svn-id: http://core.svn.wordpress.org/trunk@56747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-04 11:47:18 +00:00
hellofromTonya
d913aebb4f Fonts: Fix font_style typo in wp_print_font_faces().
Changes `font_style` to `font-style` to reflect the CSS property.

Follow-up to [56540].

Props tmatsuur, rajinsharwar, audrasjb. 
Fixes #59858.
Built from https://develop.svn.wordpress.org/trunk@57240


git-svn-id: http://core.svn.wordpress.org/trunk@56746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-03 22:13:18 +00:00
hellofromTonya
d30fe43245 Docs: Replace "sanity" with "confidence" for inclusive language.
The phrase "sanity check" unnecessarily references mental health. It's an old phrase used to denote an extra step in verifying code works as expected.

“The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included.”

While "sanity check" is a well-known phrase with a specific meaning, "confidence check" is a direct replacement that is more clear of its intent while being more inclusive.

Words matter.

Follow-up to [49216], [46271], [40583], [38832], [38637], [37409], [33359], [32162], [30346], [30345], [30238], [30055], [29902], [28763], [26141], [25002], [22227], [13428], [12148], [11025], [8927].

Props dartiss, hellofromTonya.
Fixes #60187.
Built from https://develop.svn.wordpress.org/trunk@57239


git-svn-id: http://core.svn.wordpress.org/trunk@56745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-03 21:59:19 +00:00
Sergey Biryukov
87a8377de2 Customize: Pass the previous status to post trash hooks when trashing a changeset.
This ensures that the correct number of arguments is passed to post trash hooks in `WP_Customize_Manager::trash_changeset_post()`, which bypasses `wp_trash_post()`.

Follow-up to [56043].

Props joelcj91, mukesh27.
Fixes #60183.
Built from https://develop.svn.wordpress.org/trunk@57238


git-svn-id: http://core.svn.wordpress.org/trunk@56744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-03 16:22:20 +00:00
Sergey Biryukov
997e4bc41e Tests: Use more specific assertions in wp_scheduled_delete() tests.
Includes clarifying test method names and descriptions.

Follow-up to [57224].

See #59938.
Built from https://develop.svn.wordpress.org/trunk@57237


git-svn-id: http://core.svn.wordpress.org/trunk@56743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-02 15:59:19 +00:00
Sergey Biryukov
4a14689016 Docs: Remove a trailing period from a URL in a @see tag.
This ensures that the ticket link works as expected.

Follow-up to [55005].

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


git-svn-id: http://core.svn.wordpress.org/trunk@56742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-01 14:17:16 +00:00
Gary Pendergast
7d7a52367d Happy New Year! 😘
Update copyright year to 2024 in `license.txt` and bundled themes.

Follow-up to [18201], [23306], [28064], [36855], [36856], [39659], [40241], [42424], [46719], [46720], [47025], [47026], [49915], [52427], [55024].


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


git-svn-id: http://core.svn.wordpress.org/trunk@56741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-01 00:02:19 +00:00
Sergey Biryukov
f06012264c Docs: Document the $wp_registered_sidebars global in wp_map_sidebars_widgets().
Follow-up to [41555].

Props shailu25.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57234


git-svn-id: http://core.svn.wordpress.org/trunk@56740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-31 13:34:20 +00:00
Sergey Biryukov
ced2ac5437 Docs: Correct the variable name passed to the determine_locale filter.
Follow-up to [43776], [44134].

Props truptikanzariya.
Fixes #60167.
Built from https://develop.svn.wordpress.org/trunk@57233


git-svn-id: http://core.svn.wordpress.org/trunk@56739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-30 11:46:24 +00:00
Sergey Biryukov
366d370d37 Canonical: Check if the author parameter is a string in redirect_canonical().
This avoids a PHP warning or error when viewing an author on the front end, while an array is passed as `$_GET['author']`.

Follow-up to [12034], [12040], [12202].

Props david.binda, antonvlasenko, azaozz, SergeyBiryukov.
Fixes #60059.
Built from https://develop.svn.wordpress.org/trunk@57232


git-svn-id: http://core.svn.wordpress.org/trunk@56738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-29 13:54:17 +00:00
Andrea Fercia
4388ba3a03 External Libraries: Accessibility: Clean up clipboard.js Copy buttons from focus management workaround.
`clipboard.js` used to suffer from a bug that triggered a focus loss when activating the Copy buttons. The bug was fixed a while ago with the `clipboard.js` 2.0.11 release so that the workaround implemented in WordPress is no longer necessary.

Props dhrumilk, paulkevan, afercia.
Fixes #60139.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-28 15:27:15 +00:00
Sergey Biryukov
a0b82585ab Docs: Document the $post global in REST API posts and revisions controllers.
Follow-up to [38832], [40601].

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57230


git-svn-id: http://core.svn.wordpress.org/trunk@56736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-28 15:19:20 +00:00
Sergey Biryukov
45aea1a36d Twenty Twenty-Four: Use consistent title case in custom template names.
Follow-up to [56716].

Props wildworks, mukesh27.
Fixes #60083.
Built from https://develop.svn.wordpress.org/trunk@57229


git-svn-id: http://core.svn.wordpress.org/trunk@56735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-27 11:01:22 +00:00
Sergey Biryukov
ae1c461ed5 KSES: Add background-repeat to the list of safe CSS properties.
Follow-up to [45242], [46235].

Props andrewserong, ramonopoly, mukesh27.
Fixes #60132.
Built from https://develop.svn.wordpress.org/trunk@57228


git-svn-id: http://core.svn.wordpress.org/trunk@56734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-26 14:24:21 +00:00
Sergey Biryukov
13f7ee3063 Coding Standards: Correct alignment in WP_HTML_Tag_Processor::apply_attributes_updates().
This fixes an `Equals sign not aligned correctly` WPCS warning.

Follow-up to [57179].

Props antonvlasenko, dmsnell, ironprogrammer.
Fixes #60078.
Built from https://develop.svn.wordpress.org/trunk@57227


git-svn-id: http://core.svn.wordpress.org/trunk@56733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-25 14:03:19 +00:00
Sergey Biryukov
356dd51612 Docs: Document the $wp_hasher global in wp_generate_user_request_key().
Includes adding a description for the global in a few other functions.

Follow-up to [42791], [42964], [43008].

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57226


git-svn-id: http://core.svn.wordpress.org/trunk@56732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-24 13:05:21 +00:00
Sergey Biryukov
9b09f2c239 Customize: Remove unused $wpdb global in _wp_customize_publish_changeset().
Follow-up to [38810], [39180], [41192], [41824].

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57225


git-svn-id: http://core.svn.wordpress.org/trunk@56731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-23 14:43:22 +00:00
Aaron Jorbin
5e201d4b5b Build/Test: Add Tests for wp_scheduled_delete.
Props pbearne.
Fixes #59938.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 15:22:24 +00:00
Sergey Biryukov
9b905f9573 Docs: Remove unused $posts global reference in get_attachment_template().
Follow-up to [32628], [32804].

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57223


git-svn-id: http://core.svn.wordpress.org/trunk@56729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 14:52:21 +00:00
isabel_brison
6e1fe93a1c REST API: check parent and revision ids match before retrieving revision.
Adds a condition to check that parent id matches revision parent id in `WP_REST_Revisions_Controller` `get_item` method.

Props ramonopoly, adamsilverstein, danielbachhuber, spacedmonkey, andrewserong.
Fixes #59875.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 02:12:21 +00:00
desrosj
45c67f7f11 Build/Test Tools: Add missing MySQL versions for WordPress 5.0.
Follow up to [57218], [57219], [57220].

See #58977.
Built from https://develop.svn.wordpress.org/trunk@57221


git-svn-id: http://core.svn.wordpress.org/trunk@56727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 01:38:23 +00:00
desrosj
8a4bef5bcb Build/Test Tools: Run installation tests when data files are updated.
When the JSON data files that supply the PHP/MySQL version support to the installation test workflow are changed, the workflow should be run to confirm the changes are correct. This updates the `path` filtering rules to ensure this happens.

Follow up to [57218], [57219].

See #58977.
Built from https://develop.svn.wordpress.org/trunk@57220


git-svn-id: http://core.svn.wordpress.org/trunk@56726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 01:23:21 +00:00
desrosj
d8d6bee968 Build/Test Tools: Add missing PHP versions for 6.5 and 6.4.
This adds 6.4 and 6.5 to the PHP version support JSON files used to build the test matrix in the Installation Testing workflow.

Also, WP 6.3 did not support PHP 8.3.

Follow up to [57218].

See #58977.
Built from https://develop.svn.wordpress.org/trunk@57219


git-svn-id: http://core.svn.wordpress.org/trunk@56725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 01:14:20 +00:00
desrosj
f692428328 Build/Test Tools: Make the install testing workflow more flexible.
In [56661], a new GitHub Actions workflow was introduced that focused on running some minimal installation tests for a version of WordPress for every PHP and MySQL combination.

This workflow has tested well, but lacks flexibility and possesses one flaw: tests are only ever performed with currently supported versions, even if the version being tested had a different support policy.

This updates the workflow to be more flexible, allowing all versions of WordPress currently receiving security fixes (back through 4.1) to be tested under the correct support policy.

Additionally, the workflow can now run against the `nightly` build of WordPress. This replaces `latest` as the new default. This allows the tests to be run at any point during a release cycle without the need for an officially tagged version.

Props jorbin, joemcgill, costdev.
See #58977.
Built from https://develop.svn.wordpress.org/trunk@57218


git-svn-id: http://core.svn.wordpress.org/trunk@56724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 01:00:20 +00:00
Aaron Jorbin
2aee859fbf Build/Test: Update Grunt Patch Wordpress for Node 20+.
Props jorbin, desrosj.
See #59658, #59663.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-21 20:03:26 +00:00
Sergey Biryukov
af1f54d6b3 Docs: Document some globals in wp-includes/widgets.php.
Follow-up to [41555], [50995].

Props upadalavipul.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57216


git-svn-id: http://core.svn.wordpress.org/trunk@56722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-21 18:36:23 +00:00
Joe McGill
5b5e874ed5 Themes: Improve the performance of _get_block_templates_paths.
This avoids redundant recursive lookups for block template paths in the same base directory by implementing a static cache. It also replaces an potentially expensive `file_exists` call in favor of doing recursive iteration of files inside a try/catch block. 

Props thekt12, spacedmonkey, flixos90, mukesh27, joemcgill.
Fixes #58196.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 20:02:16 +00:00
desrosj
f5e051855d Build/Test Tools: Add engines for default themes.
This adds the `engines` field to the `package.json` file for the three default themes with build processes in order to encourage consistent tooling for contributors.

Some minor dependency updates for these themes are also included in this change.

Props jorbin, joemcgill, swissspidy.
See #59663.
Built from https://develop.svn.wordpress.org/trunk@57213


git-svn-id: http://core.svn.wordpress.org/trunk@56719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 18:52:15 +00:00
desrosj
775f4c4416 Build/Test Tools: Raise minimum required version of Node.js/npm.
This bumps the minimum required version of Node.js/npm from 16.19.1 and 8.19.3 to 20.10.0 and 10.2.3.

Since 20.10.0 is the latest 20.x version of Node.js, the `check-latest` option has been enabled for `actions/setup-node` in GitHub Actions workflows. This performs an additional external call to the Node.js API confirming the latest version is installed on the runner for use. In testing, it seems that 20.10.0 was not consistently deployed to all runner machines in use. This should be removed in the near future when the version of Node.js is reliably above the new minimum requirement.

The Gutenberg repository has also been updated to use the same values for `engines`.

Props jorbin, joemcgill, swissspidy, benharri, dhrupo, flootr, gziolo, noahtallen.
See #59663.
Built from https://develop.svn.wordpress.org/trunk@57212


git-svn-id: http://core.svn.wordpress.org/trunk@56718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 18:46:20 +00:00
Bernhard Reiter
8e5db640de HTML API: Avoid processing incomplete tokens.
Currently the Tag Processor assumes that an input document is a ''full'' HTML document. Because of this, if there's lingering content after the last tag match it will treat that content as plaintext and skip over it. This is fine for the Tag Processor because if there is lingering content that isn't a valid tag then there's nothing for `next_tag()` to match.

However, in order to support a number of feature expansions it is important to recognize that the remaining content ''may'' involve partial syntax elements, such as incomplete tags, attributes, or comments.

In this patch we're adding a mode inside the Tag Processor which will flip when we start parsing HTML syntax but the document finishes before the token does. This will provide the ability to:

- extend the input document,
- avoid misinterpreting syntax as text, and
- guess if we have a complete document, know if we have an incomplete document.

In the process of building this patch a few fixes were identified and fixed in the Tag Processor, namely in the handling of incomplete syntax elements.

Props dmsnell, jonsurrell.
Fixes #60122, #60108.
Built from https://develop.svn.wordpress.org/trunk@57211


git-svn-id: http://core.svn.wordpress.org/trunk@56717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 17:52:30 +00:00
Pascal Birchler
ed17b41079 Build/Test Tools: Post message for testing on Playground only after build succeeds.
Uses the `workflow_run` trigger to only leave pull request comments after the build jobs finish.

Props zieladam, desrosj.
See #59416.
Built from https://develop.svn.wordpress.org/trunk@57210


git-svn-id: http://core.svn.wordpress.org/trunk@56716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 14:52:33 +00:00
Bernhard Reiter
a586b85d8e HTML API: Apply linting changes to @TODO comments.
Lowercase `@TODO` comments introduced by [57186], and remove spurious colons after them.

Props dmsnell, TobiasBg, mukesh27, sergeybiryukov, jonsurrell.
Fixes #60060.
Built from https://develop.svn.wordpress.org/trunk@57209


git-svn-id: http://core.svn.wordpress.org/trunk@56715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 12:36:31 +00:00
Sergey Biryukov
8dd4ce9fdb Tests: Correct the @group annotation for _wp_mysql_week() tests.
Includes updating the data provider name for consistency.

Follow-up to [57207].

See #59931.
Built from https://develop.svn.wordpress.org/trunk@57208


git-svn-id: http://core.svn.wordpress.org/trunk@56714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 10:03:35 +00:00
Aaron Jorbin
2f1335258f Build/Test: Add Tests for _wp_mysql_week.
Props pbearne.
Fixes #59931.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-19 23:13:32 +00:00
Sergey Biryukov
a559c54aef Docs: Document the $shortcode_tags global in wp_just_in_time_script_localization().
Follow-up to [41395], [41844].

Props upadalavipul.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57204


git-svn-id: http://core.svn.wordpress.org/trunk@56712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-19 13:12:27 +00:00
desrosj
0244f702f0 Build/Test Tools: Add more context to artifact names.
This adds a bit more context to the E2E workflow artifact names in order to avoid duplicates being uploaded.

With the update to v4 of `actions/upload-artifact` in [57197], artifacts are now uploaded on a per job basis. Multiple jobs cannot upload the same artifact.

Props johnbillion.
See #59805.
Built from https://develop.svn.wordpress.org/trunk@57203


git-svn-id: http://core.svn.wordpress.org/trunk@56711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-18 20:34:29 +00:00
desrosj
36adf3d10b Build/Test Tools: Update third-party GitHub Actions.
This updates the following GitHub Actions to their latest versions:
- `actions/checkout`
- `actions/setup-node`
- `actions/upload-artifact`
- `actions/cache`
- `actions/github-script`
- `shivammathur/setup-php`

See #59805.
Built from https://develop.svn.wordpress.org/trunk@57197


git-svn-id: http://core.svn.wordpress.org/trunk@56708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-18 15:20:27 +00:00
Sergey Biryukov
b691849290 Docs: Document some globals in wp-includes/deprecated.php.
Includes removing `$allowed_options` global references from functions where it's not actually used.

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57196


git-svn-id: http://core.svn.wordpress.org/trunk@56707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-18 13:53:30 +00:00
Sergey Biryukov
a9b08b8e16 Docs: Correct $wp_the_query global reference in WP_Query::is_main_query().
Follow-up to [18699], [32620], [34337], [45739].

See #59651.
Built from https://develop.svn.wordpress.org/trunk@57195


git-svn-id: http://core.svn.wordpress.org/trunk@56706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-17 02:48:29 +00:00
Sergey Biryukov
fac2864841 Docs: Document the $wp_locale global in WP_Fatal_Error_Handler::handle().
Follow-up to [45277].

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57194


git-svn-id: http://core.svn.wordpress.org/trunk@56705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-16 09:38:25 +00:00
Sergey Biryukov
5883e53bbf Docs: Document the $current_screen global in _WP_Editors::editor().
Follow-up to [32899].

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57193


git-svn-id: http://core.svn.wordpress.org/trunk@56704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-16 09:31:29 +00:00
Sergey Biryukov
f0e266fd62 General: Revert code changes from [57191].
The unit tests for `get_bookmark()` expect the function to modify the `$GLOBALS` array directly.

Follow-up to [57191].

See #60021.
Built from https://develop.svn.wordpress.org/trunk@57192


git-svn-id: http://core.svn.wordpress.org/trunk@56703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-15 14:33:25 +00:00
Sergey Biryukov
e162ffa2e9 Docs: Document the $link global in get_bookmark().
Follow-up to [8758].

Props upadalavipul, mukesh27.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57191


git-svn-id: http://core.svn.wordpress.org/trunk@56702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-15 12:59:23 +00:00
Sergey Biryukov
c07e1c4442 Docs: Document the $wpdb global in WP_User::__construct().
Follow-up to [19325].

Props upadalavipul.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57190


git-svn-id: http://core.svn.wordpress.org/trunk@56701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-15 12:37:29 +00:00
Sergey Biryukov
8361461aa0 Docs: Fix typo in WP_Date_Query::build_mysql_datetime() DocBlock.
Follow-up to [25139].

Props nithi22, benniledl, mukesh27.
Fixes #60067.
Built from https://develop.svn.wordpress.org/trunk@57189


git-svn-id: http://core.svn.wordpress.org/trunk@56700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-14 10:23:27 +00:00
Sergey Biryukov
8ed54ba817 Toolbar: Add a Plugins link to the admin bar menu.
Props colomet, Girishpanchal, afercia, danieltj, rishishah, sabernhardt, joedolson,  huzaifaalmesbah, shailu25, zunaid321, devmuhib, sumitbagthariya16, yuvrajsinh2211, SergeyBiryukov.
Fixes #40683.
Built from https://develop.svn.wordpress.org/trunk@57188


git-svn-id: http://core.svn.wordpress.org/trunk@56699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-13 21:18:19 +00:00
Aaron Jorbin
497844c45b Build/Test: Update name of test to show its breadth.
The test covers multiple libraries, not just lodash.

Follow up to [57185].

Props TobiasBg.
Fixes #60048.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-13 20:02:23 +00:00
Bernhard Reiter
511dcb7520 HTML API: Add support for H1-H6 elements in the HTML Processor.
Previously these have been unsupported, but in this patch, support is added for the tags so that the HTML Processor can process documents containing them.

There was a design discussion about introducing a constant to communicate "any of the H1 - H6 elements" but this posed a number of challenges that don't need to be answered in this patch. For the time being, because the HTML specification treats H1 - H6 specially as a single kind of element, the HTML Processor uses an internal hard-coded string to indicate this. By using a hard-coded string it's possible to avoid introducing a class constant which cannot be made private due to PHP's class design. In the future, this will probably appear as a special constant in a new constant-containing class.

Props dmsnell, jonsurrell.
Fixes #60060.
Built from https://develop.svn.wordpress.org/trunk@57186


git-svn-id: http://core.svn.wordpress.org/trunk@56697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-13 17:53:19 +00:00
Aaron Jorbin
d5b96bf00d External Libraries: For Lodash, sync the declared version number with the one that is loaded.
In [50941] the version of lodash was updated, however the version inside `wp_default_packages_vendor` was not updated at the same time. This updates the version to correctly reflect the version that is loaded.

Also adds some basic tests for the scripts in `wp_default_packages_vendor` that match the name of the package from package.json to help prevent errors like this in the future.

Props jadpm, jorbin, swissspidy.
Fixes #60048. See #52991.



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


git-svn-id: http://core.svn.wordpress.org/trunk@56696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-13 17:50:31 +00:00
Sergey Biryukov
e99a116006 Tests: Add unit tests for wp_checkdate().
Follow-up to [21922].

Props pbearne, ironprogrammer, antonvlasenko, SergeyBiryukov.
Fixes #59825.
Built from https://develop.svn.wordpress.org/trunk@57184


git-svn-id: http://core.svn.wordpress.org/trunk@56695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-12 12:21:24 +00:00
Sergey Biryukov
a2bcc36278 Docs: Consistently document the $body_id global as a string.
Includes declaring the global at the beginning of `wp_iframe()` and `iframe_header()`.

Follow-up to [32642], [32643].

Props mukesh27, upadalavipul.
Fixes #60032.
Built from https://develop.svn.wordpress.org/trunk@57181


git-svn-id: http://core.svn.wordpress.org/trunk@56692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-11 12:11:22 +00:00
desrosj
fb4428dd60 Build/Test Tools: Group GitHub Action Dependabot updates.
This updates the Dependabot configuration file to make use of `groups`, configuring all third-party GitHub Action updates available into a single pull request to help reduce noise.

Props bradparbs.
See #59805.
Built from https://develop.svn.wordpress.org/trunk@57180


git-svn-id: http://core.svn.wordpress.org/trunk@56691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-11 11:50:27 +00:00
zieladam
760fae6c43 HTML API: Track spans of text with (offset, length) instead of (start, end).
Updates the internal representation of the text span coordinates. The mixture of (offset, length) and (start, end) coordinates becomes confusing, this commit replaces it with a (offset, length) pair. There should be no functional or behavioral changes in this patch. For the internal helper classes this patch introduces breaking changes, but those classes are marked private and should not be used outside of the HTML API itself.

Props dmsnell.
Fixes #59993.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-10 13:19:28 +00:00
zieladam
6af9b0dcfe Build/Test Tools: Fix the workflow that posts a preview link on every Pull Request
Fixes a 403 error in the pull-request-comments.yml job by switching from a custom workflow dispatch call to the pull_request_target trigger.

Follow up to [57124], [57174].
Props ockham.
See #59416.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-10 10:36:39 +00:00
Sergey Biryukov
83ad6a8b86 Docs: Correct the order of steps in the WordPress Core build process workflow.
Follow up to [57124], [57174].

Props swissspidy.
See #59416.
Built from https://develop.svn.wordpress.org/trunk@57177


git-svn-id: http://core.svn.wordpress.org/trunk@56688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-10 00:21:31 +00:00
Sergey Biryukov
a192ed1ae1 REST API: Pass correct number of arguments to the comment_text filter.
This ensures that `WP_REST_Comments_Controller::prepare_item_for_response()` passes three arguments to the `comment_text` filter, for consistency with all the other instances in core.

Follow-up to [15957], [16357], [25555], [38832], [40664].

Props sjregan, SergeyBiryukov.
Fixes #58238.
Built from https://develop.svn.wordpress.org/trunk@57176


git-svn-id: http://core.svn.wordpress.org/trunk@56687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-09 22:13:34 +00:00
Sergey Biryukov
1c7d7a09aa Upload: Add missing escaping in upload_space_setting().
Follow-up to [https://mu.trac.wordpress.org/changeset/1088 mu:1088], [https://mu.trac.wordpress.org/changeset/1095 mu:1095], [12603].

Props utsav72640.
Fixes #58514.
Built from https://develop.svn.wordpress.org/trunk@57175


git-svn-id: http://core.svn.wordpress.org/trunk@56686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-08 21:26:29 +00:00
zieladam
afb55f3571 Build/Test Tools: Zip WordPress files before npm run clean
Fixes a problem in WordPress artifact upload pipeline. The callable-test-core-build-process.yml used to zip the WordPress dist directory after npm run grunt clean runs, producing an empty zip file. This commit moves the zip before the cleanup task.

Follow up to [57124].

Props ockham, dmsnell.
See #59416.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-08 16:07:28 +00:00
desrosj
362b15d400 Database: Raise the minimum required version of MySQL.
This raises the minimum version of MySQL required to run WordPress from 5.0 to 5.5.5.

MySQL 5.0 and 5.1 have long been unsupported and both reached end of life over 10 years ago. Combined usage for both versions sits at 0.4% of all WordPress sites.

Because 5.5 sits at just under 15% usage, 5.5 cannot be trimmed off at this time.

Of all sites running 5.5.x, 85% are running 5.5.5, and 100% are running 5.5.5 or higher. This makes it the logical landing spot.

Props johnbillion, sergeybiryukov, jorbin.
Fixes #60036.
Built from https://develop.svn.wordpress.org/trunk@57173


git-svn-id: http://core.svn.wordpress.org/trunk@56684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-08 14:13:27 +00:00
Bernhard Reiter
ed04994d13 Block Hooks: Fix @ticket references in tests, add missing ones.
Some tests that were added in [57157] erroneously set their `@ticket` reference to #59646, rather than #60008.
This changeset rectifies that mistake.

Additionally, it adds ticket references to #60008 to tests that were modified by [57157].

Follow-up to [57157].

See #60008.
Built from https://develop.svn.wordpress.org/trunk@57172


git-svn-id: http://core.svn.wordpress.org/trunk@56683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-08 11:46:27 +00:00
isabel_brison
cf50fd40f5 Themes: fix documentation link.
Removes a period from an inline comment of `wp_block_theme_activate_nonce` that broke a link in the comment.

Props stevenlinx, mukesh27.
Fixes #60034.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-08 06:32:24 +00:00
Felix Arntz
7926dbb4d5 General: Avoid early initialization of variable in get_bloginfo().
This is a very minor, yet simple performance optimization in a commonly called function, avoiding unnecessary initialization of the `$url` variable when it may not be needed. The conditional is simple enough to not use a variable altogether.

Props Cybr, swissspidy.
Fixes #59450.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-07 22:57:28 +00:00
Sergey Biryukov
f402ce754d Docs: Improve documentation for Custom_Image_Header and Custom_Background constructors.
Follow-up to [4673], [8656], [12890], [13041].

Props faisalahammad, cadic.
Fixes #58049.
Built from https://develop.svn.wordpress.org/trunk@57169


git-svn-id: http://core.svn.wordpress.org/trunk@56680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-07 15:14:27 +00:00
Joe McGill
46406afcc4 HTML-API: Prevent unintended behavior when WP_HTML_Token is unserialized.
Props dmsnell, peterwilsoncc, dd32, xknown, rawrly, johnbillion, barry, jeffpaul, vortfu, isabel_brison, mikeschroder, jorbin.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-06 16:05:19 +00:00
Sergey Biryukov
ebb9657bf7 Docs: Fix typo in Gettext_Translations::parenthesize_plural_exression() description.
Follow-up to [10584], [12079], [41722], [57161].

Props tohincoderex.
See #59347.
Built from https://develop.svn.wordpress.org/trunk@57162


git-svn-id: http://core.svn.wordpress.org/trunk@56673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-06 11:54:17 +00:00
Sergey Biryukov
e0d74dfb10 I18N: Deprecate Gettext_Translations::parenthesize_plural_exression().
Aside from having a typo in the name, the method is unused by core as of WordPress 4.9.

Follow-up to [10584], [12079], [41722].

Props tohincoderex, jrf.
Fixes #59347.
Built from https://develop.svn.wordpress.org/trunk@57161


git-svn-id: http://core.svn.wordpress.org/trunk@56672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-06 11:50:26 +00:00
Sergey Biryukov
7eec58966d Administration: Don't unnecessarily escape none or div in the admin menu.
This matches a similar conditional in `wp-admin/menu-header.php`, where these values are handled as special cases and don't output the default menu image so that an icon could be added to `div.wp-menu-image` as CSS background. 

Follow-up to [9578], [21877], [26664].

Props andrewleap, ironprogrammer, azaozz.
Fixes #58361.
Built from https://develop.svn.wordpress.org/trunk@57159


git-svn-id: http://core.svn.wordpress.org/trunk@56670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-05 13:39:28 +00:00
Sergey Biryukov
65bbe06a00 Coding Standards: Add missing escaping in wp-activate.php.
Follow-up to [13884].

Props dilipbheda, mukesh27, pitamdey, nareshbheda.
Fixes #59200.
Built from https://develop.svn.wordpress.org/trunk@57158


git-svn-id: http://core.svn.wordpress.org/trunk@56669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 22:07:27 +00:00
Bernhard Reiter
5e795b65ef Block Hooks: Store ignored hooked blocks metadata in anchor block.
The biggest tradeoff that was made in the implementation of Block Hooks was that they were limited to layouts (i.e. templates, template parts, and patterns) that ''didn't have any user modifications'' (see #59313 for the reason). This changeset is a preparatory step to remove this limitation, so they’ll eventually also work with user-modified layouts.

The crucial problem to solve is how to acknowledge that a user has opted to remove or persist a hooked block, so that the auto-insertion mechanism won't run again and inject an extraneous hooked block on the frontend when none is solicited.

This is achieved by storing all known blocks hooked to a given anchor block in the `metadata` attribute on that anchor block; specifically in a field called `ignoredHookedBlocks` inside of the `metadata`. Hooked blocks are only rendered on the frontend if they're absent from that field; OTOH, they're injected into that field (via the REST API) when first loaded in the editor.

This simple logic guarantees that once a user modifies a given layout, those changes are respected on the frontend; yet if a plugin that includes a hooked block is activated after those modifications have taken place, the hooked block will be rendered on the frontend. This new technique supplants the one previously used (i.e. rendering hooked blocks on the frontend only if a layout doesn't have any modifications) in a rather direct way.

Note that this changeset only introduces the new metadata field and relevant logic; it does not yet enable hooked block insertion into modified layouts. That will be done in a subsequent step (see #59646).

Props gziolo.
Closes #60008.
Built from https://develop.svn.wordpress.org/trunk@57157


git-svn-id: http://core.svn.wordpress.org/trunk@56668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 20:26:22 +00:00
Felix Arntz
04152c0b91 Themes: Clean up inactive themes' theme mods from being autoloaded as part of upcoming 6.5 upgrade routine.
Alongside [57153], this reduces unnecessarily autoloaded data from inactive themes, which can contribute to slow database performance as part of excessive autoloading. This changeset specifically resolves the issue for existing sites.

Props mukesh27, joemcgill, swissspidy, westonruter, flixos90.
Fixes #59975.
See #39537.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 19:51:23 +00:00
Felix Arntz
3a961371dc Themes: Avoid autoloading the previous theme's theme mods when switching to another theme.
This reduces unnecessarily autoloaded data from inactive themes, which can contribute to slow database performance as part of excessive autoloading.

Props mukesh27, rajinsharwar, igmoweb, joemcgill, swissspidy, westonruter, flixos90.
Fixes #59537.
See #59975.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 19:38:22 +00:00
desrosj
65d5985a7c Build/Test Tools: Update the MariaDB test strategy matrix.
This updates the test strategy matrix in the PHPUnit test GitHub Actions workflow to include the most recent MariaDB release, 11.2.

While 11.0 and 11.1 are still maintained, all three are short-term stable releases, which see support dropped after 1 year.

Until a larger discussion around how the project supports database software releases with shorter support windows takes place (short-term in MariaDB or “innovation” releases in MySQL), testing only against the latest short-term release should be sufficient.

Props johnbillion, l1nuxjedi.
See #59806.
Built from https://develop.svn.wordpress.org/trunk@57152


git-svn-id: http://core.svn.wordpress.org/trunk@56663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 18:52:22 +00:00
Aaron Jorbin
b5801411cf Help/About: Change CSS align-item for full browser support.
The values of `start` and `end` are not fully supported by Opera Mini which has 1.01% usage. There is no material change in functionality with this change.

Props kebbet, NekoJonez, luminuu, hellofromTonya.
Fixes #59819.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 18:07:26 +00:00
Sergey Biryukov
42c693e244 Docs: Add missing argument type for supports in register_post_type().
If set to `false`, no feature support is registered for the post type.

Follow-up to [12751], [20734], [29091], [37883].

Props jeremyfelt, swissspidy.
Fixes #59690.
Built from https://develop.svn.wordpress.org/trunk@57150


git-svn-id: http://core.svn.wordpress.org/trunk@56661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-03 20:01:29 +00:00
Sergey Biryukov
e47eb54945 Build/Test Tools: Allow overriding the WP_UnitTestCase_Base::factory() method.
This allows third-party plugins to write their own factory extending `WP_UnitTest_Factory` for testing purposes, as well as benefit from `WP_UnitTestCase_Base` features.

Follow-up to [35186], [35225], [35242].

Props hugod.
Fixes #59999.
Built from https://develop.svn.wordpress.org/trunk@57149


git-svn-id: http://core.svn.wordpress.org/trunk@56660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-02 11:58:27 +00:00
Sergey Biryukov
db7cb1dea2 Upgrade/Install: Add port number to target origin when decrementing update counts.
This ensures that the update counter bubble in the admin menu is properly decreased after a successful plugin or theme update from within the update iframe when the site uses a non-standard port number.

Follow-up to [27280], [29357].

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


git-svn-id: http://core.svn.wordpress.org/trunk@56659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-01 01:35:28 +00:00
hellofromTonya
ea6ccb240c REST API: Restore site logo and icon in index.
Restores setting the site's logo, icon, and wp-admin's back button image (which defaults to W).

Prior to [56566], the site logo and icon were unconditionally added to the index. [56566] changed this by conditionally adding them if either the `_links` or `_embedded` fields were included. However, these fields are not included when using the Site Logo block, as it uses the `site_logo`, `site_icon`, and `site_icon_url` fields instead.

This changeset restores the functionality by checking specifically for the `site_*` fields when neither of the `_links` or `_embedded` fields are present.

Follow up to [56566].

Props antonvlasenko, hellofromTonya, ironprogrammer, priethor, wildworks.
Fixes #59935.
Built from https://develop.svn.wordpress.org/trunk@57147


git-svn-id: http://core.svn.wordpress.org/trunk@56658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-30 14:54:24 +00:00
Sergey Biryukov
26cd5654fe Tests: Update _wp_timezone_choice_usort_callback() tests for consistency.
* Use the same `@group` annotation as the other tests.
* Use `assertSame()` to verify the type of the result.
* Use `data_` prefix for the data provider.
* Use named data set in the data provider. This makes the output when using the `--testdox` option more descriptive and is helpful when trying to debug which data set from a data provider failed the test.
* Other minor corrections.

Reference: [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#repetitive-tests Core Handbook: Writing PHP Tests: Repetitive Tests].

Follow-up to [57145].

See #59953, #59647.
Built from https://develop.svn.wordpress.org/trunk@57146


git-svn-id: http://core.svn.wordpress.org/trunk@56657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-30 11:17:27 +00:00
Aaron Jorbin
0a39322193 Add automated tests for _wp_timezone_choice_usort_callback
Props pbearne.
Fixes #59953.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-29 17:33:21 +00:00
hellofromTonya
064b90c078 Plugins: Fix Add Plugin search button pos when JS off.
When JavaScript is disabled, the Add Plugins screen's search button position was too high in comparison to the search text field. This fix reuses the CSS declaration to keep field and button aligned.

By targeting the `.no-js` class, the CSS specificity is not impacted when JavaScript is enabled.

Follow up to [48281], [30830].

Props devmuhib, sabernhardt, huzaifaalmesbah, hellofromTonya.
Fixes #59967.
Built from https://develop.svn.wordpress.org/trunk@57144


git-svn-id: http://core.svn.wordpress.org/trunk@56655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-29 16:45:26 +00:00
Pascal Birchler
b7a29ea18c Test: Run database upgrades between performance test steps.
Prevents pending upgrades from blocking tests when checking out previous builds.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-29 11:54:23 +00:00