Includes:
* Wrapping long lines for better readability.
* Bringing some consistency to the placement of `href` and `aria-label` attributes.
* Adding missing `aria-label` attributes for Live Preview links.
Follow-up to [26726], [52020], [51083].
Props patelketan, sainathpoojary, SergeyBiryukov.
Fixes#62405.
Built from https://develop.svn.wordpress.org/trunk@59400
git-svn-id: http://core.svn.wordpress.org/trunk@58786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Output DOCTYPE when calling `WP_HTML_Processor::serialize` on a full document that includes a DOCTYPE.
The DOCTYPE should be included in the serialized/normalized HTML output as it has an impact in how the document is handled, in particular whether the document should be handled in quirks or no-quirks mode.
This only affects the serialization of full parsers at this time because DOCTYPE tokens are currently ignored in all possible fragments. The omission of the DOCTYPE is subtle but can change the serialized document's quirks/no-quirks mode.
Props jonsurrell.
Fixes#62396.
Built from https://develop.svn.wordpress.org/trunk@59399
git-svn-id: http://core.svn.wordpress.org/trunk@58785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Aligns on the behavior of the negation operator with directives to missing paths in client and in server.
With a directive like the following:
{{{
<div data-wp-bind--hidden="!state.missing.property">
This should be hidden by the <code>hidden</code> attribute.
</div>
}}}
Both server and client will return with this fix:
{{{
<div data-wp-bind--hidden="!state.missing.property" hidden="">
This should be hidden by the <code>hidden</code> attribute.
</div>
}}}
Props jonsurrell, luisherranz.
Fixes#62374.
Built from https://develop.svn.wordpress.org/trunk@59398
git-svn-id: http://core.svn.wordpress.org/trunk@58784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates certain local Docker environment commands to include `--rm`, which instructs `docker compose` to remove the container after running the specified scripts.
Previously only the installation script contained `--rm`. But running `test:php`, `env:start`, or `env:cli` resulted in the container remaining.
Props johnbillion.
Fixes#62395.
Built from https://develop.svn.wordpress.org/trunk@59393
git-svn-id: http://core.svn.wordpress.org/trunk@58779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When the HTML Processor seeks to an earlier place, it returns the the beginning of the document and proceeds forward until it reaches the appropriate location. This requires resetting internal state so that the processor can correctly proceed from the beginning of the document.
The seeking reset logic was not adapted to account for the full processor (i.e. when created via `WP_HTML_Processor::create_full_parser()`). This change updates the seek logic to account for the full and fragment parsers as well as other state that has been introduced in the interim and should be reset.
Props jonsurrell, dmsnell, westonruter, mi5t4n.
Fixes#62290.
Built from https://develop.svn.wordpress.org/trunk@59391
git-svn-id: http://core.svn.wordpress.org/trunk@58777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This change makes the border of the pull quote block visible in the editor when the user selects a border color or thickness,
by setting the default border style to solid.
Props nidhidhandhukiya, ugyensupport, dhruvang21, sabernhardt, divyeshk71, poena.
Fixes#62301.
Built from https://develop.svn.wordpress.org/trunk@59390
git-svn-id: http://core.svn.wordpress.org/trunk@58776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When uploading `wav` files in the editor, Chrome and other browsers identify the mime type of the file as `audio/wav`. Firefox, however, identifies the mime type as `audio/x-wav`.
This commit updates the `'wav'` mime type key in `wp_get_mime_types()` to support `x-wav` so that uploading wav files work in Firefox. Previously, the editor reported an unsupported mime type error.
Props imranh920, ramonopoly.
Fixes #61948.
Built from https://develop.svn.wordpress.org/trunk@59389
git-svn-id: http://core.svn.wordpress.org/trunk@58775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
After the SimplePie library was updated to version `1.8.0` in [59141], an edge case has been discovered where a fatal error can encountered if the `blog_charset` option is missing or empty.
In `fetch_feed()`, this option is retrieved using `get_option()` instead of `get_bloginfo( ‘charset’ )`. The latter will detect this scenario and apply a default value of `UTF-8` and is already used interchangeably throughout Core. This switches to `get_bloginfo( ‘charset’ )` instead to prevent this edge case.
Props david.binda, davidbaumwald, SergeyBiryukov, sabernhardt, azaozz, peterwilsoncc.
Fixes#62354.
Built from https://develop.svn.wordpress.org/trunk@59382
git-svn-id: http://core.svn.wordpress.org/trunk@58768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes the dimension suffix, eg `-1000x1000` from the file name of full size images automatically converted from HEIC to JPEGs by WordPress. Introduces unit tests for the default conversion of images and customized conversion settings via the `image_editor_output_format` filter.
Follow up to [58849], [58942], [59317], [59346], [59366]
Props mukesh27, peterwilsoncc, azaozz, apermo, flixos90, ironprogrammer.
Fixes#62359.
See #53645, #62305.
Built from https://develop.svn.wordpress.org/trunk@59379
git-svn-id: http://core.svn.wordpress.org/trunk@58765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes a redundant `isset( $HTTP_RAW_POST_DATA )` from `xmlrpc.php`, as the variable is already set in the code block immediately preceding the affected line.
Follow-up to [3498], [5445], [47926].
Props justlevine.
See #52217.
Built from https://develop.svn.wordpress.org/trunk@59376
git-svn-id: http://core.svn.wordpress.org/trunk@58762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This addresses an issue where a string (`$current`) is compared to an integer (`$last_saved`). The issue is resolved by casting the results of `preg_replace()` to type `int` when `$current` is defined.
Follow-up to [8784], [10083], [25109].
Props justlevine.
See #52217.
Built from https://develop.svn.wordpress.org/trunk@59373
git-svn-id: http://core.svn.wordpress.org/trunk@58759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Currently, Dependabot is configured to open pull requests when updates to 3rd-party GitHub Actions become available.
It does a great job at this. Thank you very much, 🤖 Mr. Dependabot Roboto.
Some of the automated comments for pull requests are not relevant to PRs opened by Dependabot. Despite how good of a robot it is, Dependabot will never open a Trac ticket, so it's pointless to ask for one.
Also, since it’s currently only configured to watch GitHub Actions for updates, there will never be a need to test Dependabot PRs in Playground. If instructed to monitor npm dependencies in the future, this comment can be added back as those packages can directly affect the built software that is distributed.
Props johnbillion.
See #62221.
Built from https://develop.svn.wordpress.org/trunk@59370
git-svn-id: http://core.svn.wordpress.org/trunk@58756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In `WP_Theme_JSON::get_valid_block_style_variations()`, the method was calling `self::get_blocks_metadata()` even though the metadata was already retrieved in the parent function. This update reuses the existing block metadata instead of calling it again.
A new optional parameter, `$blocks_metadata`, has been added to the function, allowing it to use pre-fetched metadata when available, improving efficiency.
Fewer `self::get_blocks_metadata()` calls mean faster processing, especially in themes with many blocks.
Props mukesh27, ramonopoly, aaronrobertshaw, flixos90.
Fixes #62291.
Built from https://develop.svn.wordpress.org/trunk@59359
git-svn-id: http://core.svn.wordpress.org/trunk@58745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves an issue where the private property `WP_User_Query::$results` is accessed directly in `WP_REST_Users_Controller::get_items()` instead of via the `::get_results()` method.
Follow-up to [38832].
Props justlevine.
See #52217.
Built from https://develop.svn.wordpress.org/trunk@59357
git-svn-id: http://core.svn.wordpress.org/trunk@58743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds documentation for how to generate code coverage reports to the README.md file.
`test:coverage` has also been added as an npm script to make it easier to generate a report using the local Docker environment. The script will generate an HTML, PHP, and text report file.
Props pbearne, hellofromTonya, netweb.
Fixes#53414.
Built from https://develop.svn.wordpress.org/trunk@59356
git-svn-id: http://core.svn.wordpress.org/trunk@58742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[59287] updated the test coverage workflow to make use of the reusable PHPUnit workflow logic to prevent having duplicate code. The workflow should be run when the reusable file is updated to confirm any changes made work as expected.
See #62221.
Built from https://develop.svn.wordpress.org/trunk@59355
git-svn-id: http://core.svn.wordpress.org/trunk@58741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes an issue with the usage of the new `$wp_styles->get_etag()` method in `wp-admin/load-styles.php`, where `$wp_version` is passed as the first argument instead of `$load` being used as the ''only'' argument.
Follow-up to [58935].
Props justlevine, mukesh27, swissspidy.
See #52217, #61485.
Built from https://develop.svn.wordpress.org/trunk@59341
git-svn-id: http://core.svn.wordpress.org/trunk@58727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit corrects several instances of `test_*()` methods potentially returning `void` instead of their documented return types.
Since these methods are public, `null` is used to represent a passed test for backward compatibility with the coercion of the previously-returned `void`. Previous usage of `false` is preserved.
Includes updating some `@return` tags for clarity.
Follow-up to [44986], [46276], [49927].
Props justlevine, apermo, SergeyBiryukov.
See #52217.
Built from https://develop.svn.wordpress.org/trunk@59340
git-svn-id: http://core.svn.wordpress.org/trunk@58726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit affects `WP_Theme_JSON_Resolver::resolve_theme_file_uris()`.
When setting resolved URIs in an incoming theme json object, this commit removes the unnecessary call to `WP_Theme_JSON->merge()`.
Why? `WP_Theme_JSON_Resolver::resolve_theme_file_uris()` only needs to set values for paths in the raw theme json object. It can then return a new theme object based on the updated JSON source. There's no need for a full and possibly expensive merge.
Follow-up to [61588].
Props ramonopoly, aaronrobertshaw, andrewserong.
Fixes #62329.
Built from https://develop.svn.wordpress.org/trunk@59338
git-svn-id: http://core.svn.wordpress.org/trunk@58724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit fixes an issue where some magic `__isset()` methods were potentially returning `void` (if the prop is not in an allow-listed array of fields) instead of an explicit boolean `false`.
Addressed methods:
* `WP_Comment::__isset()`
* `WP_Query::__isset()`
Follow-up to [28523], [31151], [34583], [34599].
Props justlevine.
See #52217.
Built from https://develop.svn.wordpress.org/trunk@59337
git-svn-id: http://core.svn.wordpress.org/trunk@58723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit adds missing `void` return types to (parent) methods that can ''explicitly'' return `void` as one of their conditional paths.
Addressed methods:
* `WP_Privacy_Requests_Table::column_status()`
* `WP_Recovery_Mode::handle_error()`
* `WP_Widget::form()` — unlike the others, it's the ''child'' classes that return `void` when the method is correctly implemented.
Note: `@return void` (where `void` is the single type returned) should not be used outside the default bundled themes and the PHP compatibility shims included in WordPress Core, as per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/ documentation standards].
Follow-up to [30382], [42967], [43256], [44973], [45448].
Props justlevine.
See #52217, #62281.
Built from https://develop.svn.wordpress.org/trunk@59336
git-svn-id: http://core.svn.wordpress.org/trunk@58722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit fixes an omission in the logic of `WP_Theme_JSON::merge()` where top-level background image style objects are not replaced, rather they are merged. Because background images are self contained objects, their properties are unique and should not be merged. Blocks are already catered for via `WP_Theme_JSON::get_block_nodes()`.
Follow-up to [61858].
Props ramonopoly, andrewserong.
Fixes #62328.
Built from https://develop.svn.wordpress.org/trunk@59335
git-svn-id: http://core.svn.wordpress.org/trunk@58721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Reverts an earlier change to the test suite in which the PHPUnit tests could not run if the importer plugin was not available.
This update allows the test suite to run and will fail importer tests if the plugin is not available.
Follow up to r59085.
Props peterwilsoncc, azaozz.
See #62325.
Built from https://develop.svn.wordpress.org/trunk@59326
git-svn-id: http://core.svn.wordpress.org/trunk@58712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The previous approach of running `wp_allow_comment()` twice could have unintended consequences, e.g. the `check_comment_flood` action was also triggered twice, which might lead to false-positive identification of comment flood in case there is some custom callback hooked to it, which is not expecting identical data seeing twice.
This commit introduces a new function, `wp_check_comment_data()`, to specifically check for disallowed content before and after comment data is filtered.
Follow-up to [59267].
Props david.binda, SergeyBiryukov.
See #61827.
Built from https://develop.svn.wordpress.org/trunk@59319
git-svn-id: http://core.svn.wordpress.org/trunk@58705 1a063a9b-81f0-0310-95a4-ce76da25c4cd