This brings more consistency with the other files having the same pattern:
* `wp-admin/moderation.php`
* `wp-admin/ms-admin.php`
* `wp-admin/ms-edit.php`
* `wp-admin/ms-sites.php`
* `wp-admin/ms-themes.php`
* `wp-admin/ms-upgrade-network.php`
* `wp-admin/ms-users.php`
Follow-up to [15481], [16847].
Props jigar-bhanushali, jorbin, johnbillion, Presskopp, rajinsharwar, audrasjb, SergeyBiryukov.
Fixes#60926.
git-svn-id: https://develop.svn.wordpress.org/trunk@58460 602fd350-edb4-49c9-b593-d223f7449a82
This changeset removes text strings from the query pagination block that are not translatable without adding them to patterns.
This means that the texts now use the default translation for the block from WordPress, not the theme. The archive, search and home templates now match the text in the query pagination in the index template.
Props poena.
Fixes#60298.
git-svn-id: https://develop.svn.wordpress.org/trunk@58459 602fd350-edb4-49c9-b593-d223f7449a82
Cast crop values to integers to prevent PHP error caused by implicit conversion from `float` to `int` values when cropping images using ImageMagick.
Props skithund, mai21, nicomollet, amanias1977, joedolson.
Fixes#59782.
git-svn-id: https://develop.svn.wordpress.org/trunk@58457 602fd350-edb4-49c9-b593-d223f7449a82
The admin image editor crop function introduced rounding errors by using a scaled image to calculate values. Fix uses the image at 100% scale for calculations. Also avoid recalculating selection when the selection position is changed, and prevent incorrect values after scaling or restoration.
Props Jossnaz, johnillo, shailu25, rachelbaker, sudipatel007, joedolson.
Fixes#32282.
git-svn-id: https://develop.svn.wordpress.org/trunk@58456 602fd350-edb4-49c9-b593-d223f7449a82
Add the attribute `role="alert"` on 12 instances of admin notices that are injected into the DOM using JavaScript. The `role="alert"` attribute allows screen readers to recognize the addition to the DOM and announce the errors to users.
Props afercia, cyrus11, rcreators, joedolson.
Fixes#47111.
git-svn-id: https://develop.svn.wordpress.org/trunk@58455 602fd350-edb4-49c9-b593-d223f7449a82
Document each element within the filter parameter `$clauses` associative array structure for the `'comments_clauses'`, `'networks_clauses'`, and `'sites_clauses'` filters.
This change:
* Brings consistency amongst the `WP_[*_]Query` filters.
* Helps to improve understanding.
* Helps to avoid confusion of the purpose for `pieces` and `clauses`.
Follow-up to [53376], [53375], [52974].
Props david.binda, audrasjb, hellofromTonya, ironprogrammer, johnbillion, oglekler, SergeyBiryukov.
Fixes#61307.
git-svn-id: https://develop.svn.wordpress.org/trunk@58454 602fd350-edb4-49c9-b593-d223f7449a82
The pullquote block was ignoring font weight and style settings. This now brings in a fix using inherit.
Props nidhidhandhukiya, desrosj, sabernhardt.
Fixes#56695.
git-svn-id: https://develop.svn.wordpress.org/trunk@58453 602fd350-edb4-49c9-b593-d223f7449a82
Adds template and template_lock property of the post type to post types REST API endpoint.
This change allows us to fix a bug where the template of a page is not respected when creating a new page on the site editor.
Props jorgefilipecosta, oandregal, timothyblynjacobs, mukesh27.
Fixes#61477.
git-svn-id: https://develop.svn.wordpress.org/trunk@58452 602fd350-edb4-49c9-b593-d223f7449a82
This adds in a useful file to know how to compiled this theme. As there was previously a contributing file with instruction on this in the GitHub repo that was not brought into svn, this fixes that.
Props kjeller, nielslange, sabernahardt.
Fixes#46108.
git-svn-id: https://develop.svn.wordpress.org/trunk@58451 602fd350-edb4-49c9-b593-d223f7449a82
Set `aria-modal` and `aria-hidden` attributes when the Classic Editor link inserter modal is active, so that content behind the modal will be properly treated as inert when interacting with the modal.
Props lyonmuller, jwgoedert, sabernhardt, alexstine, afercia, rajinsharwar, rcreators, audrasjb, hmbashar, joedolson.
Fixes#60799.
git-svn-id: https://develop.svn.wordpress.org/trunk@58450 602fd350-edb4-49c9-b593-d223f7449a82
Update behavior of admin menu so that the `aria-haspopup` attribute is only applied in responsive mode, when there is a popup behavior present. Add `aria-expanded` attributes to report current popup state.
Props afercia, khokansardar, ryokuhi, joedolson.
Fixes#43095.
git-svn-id: https://develop.svn.wordpress.org/trunk@58449 602fd350-edb4-49c9-b593-d223f7449a82
Match the naming behavior for uploaded media in the REST API to the way media is named when uploading in the media library. Fix an issue where dashes were replacing spaces unnecessarily.
Props abitofmind, kadamwhite, spacedmonkey, adamsilverstein, audrasjb, hellofromTonya.
Fixes#57957.
git-svn-id: https://develop.svn.wordpress.org/trunk@58447 602fd350-edb4-49c9-b593-d223f7449a82
This replaces an erroneous `printf()` call with `sprintf()` that was missed when updating this fragment to use `wp_admin_notice()`.
Follow-up to [56571].
Props wojtekn, sabernhardt, rajinsharwar.
Fixes#61465.
git-svn-id: https://develop.svn.wordpress.org/trunk@58446 602fd350-edb4-49c9-b593-d223f7449a82
Updates the root padding CSS selectors so direct children of full width container blocks with flow layout receive padding.
Props isabel_brison, aaronrobertshaw.
Fixes#61464.
git-svn-id: https://develop.svn.wordpress.org/trunk@58444 602fd350-edb4-49c9-b593-d223f7449a82
This checks that objects returned from any of the `wp_theme_json_data_` filters are `WP_Theme_JSON_Data` objects in order to avoid incompatibilities. Otherwise, reprocess the theme.json data as new `WP_Theme_JSON` objects to ensure the data matches the expectations of code consuming that data.
Follow-up to [58185].
Props joemcgill, adamsilverstein, oandregal, ryelle, ocean90, pbearne.
See #61112.
git-svn-id: https://develop.svn.wordpress.org/trunk@58443 602fd350-edb4-49c9-b593-d223f7449a82
This further reduces image size by ~1.5 KB after running `npm run grunt precommit:image`.
Follow-up to [38833], [57322].
See #58996.
git-svn-id: https://develop.svn.wordpress.org/trunk@58442 602fd350-edb4-49c9-b593-d223f7449a82
Adds a `role="group"` to the WordPress admin bar menu list items to fix the following accessibility issue:
{{{
Elements with an ARIA [role] that require children to contain a specific [role] are missing some or all of those required children.
}}}
Reference:
* [https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/group_role ARIA: group role] via mdn web docs
Follow-up to [42128], [21193], [19558].
Props heinperu, joedolson, krupajnanda, rajinsharwar, rcreators, sabernhardt.
Fixes#60919.
git-svn-id: https://develop.svn.wordpress.org/trunk@58438 602fd350-edb4-49c9-b593-d223f7449a82
Fixes a PHP 8.1 and above "null to non-nullable" deprecation notice in `get_available_post_mime_types()`:
{{{
Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ./wp-includes/post.php on line 3395
}}}
[https://developer.wordpress.org/reference/functions/get_available_post_mime_types/#return This function is documented] to:
* Return `An array of MIME types.`
* as an array of `string`s, i.e. `string[]`.
A `null` or empty element within the returned array is not a valid MIME type. If a `null` exists in the returned array, it is the root cause of PHP throwing the deprecation notice.
This commit removes the `null` and empty elements from the returned array of MIME types. It also adds a unit test.
Follow-up to [56623], [56452].
Props nosilver4u, jrf, ironprogrammer, antpb, antonvlasenko, rajinsharwar, hellofromTonya.
Fixes#59195.
git-svn-id: https://develop.svn.wordpress.org/trunk@58437 602fd350-edb4-49c9-b593-d223f7449a82
In [58128], additional maintenance mode calls were added to the automatic updates process. However, there is an early return if a 'core' automatic update fails.
Maintenance mode isn't disabled until later in the `WP_Automatic_Updater::update()` method. This means that maintenance mode may continue to be enabled despite the core update being treated as a skipped update.
This disables maintenance mode before the early return.
Follow-up to [58128].
Props costdev, hellofromTonya, peterwilsoncc.
Fixes#61459. See #58281.
git-svn-id: https://develop.svn.wordpress.org/trunk@58436 602fd350-edb4-49c9-b593-d223f7449a82
After installation, the user is directed to the `Log In` page. This triggers the `wp_schedule_update_checks()` function which is hooked to `init` and schedules updates to run immediately if no other events exist. As a result of more robust use of maintenance mode for automatic updates added in [58128], the user may be presented with a maintenance mode screen just after installing WordPress.
To improve the user experience, this schedules core updates for 1 hour, plugin updates for 1.5 hours, and theme updates for 2 hours after installation.
Follow-up to [58128], [58139], [58308], [58309].
Props afragen, hellofromTonya, peterwilsoncc, nithi22, dd32.
Fixes#61457. See #58281, #61391.
git-svn-id: https://develop.svn.wordpress.org/trunk@58435 602fd350-edb4-49c9-b593-d223f7449a82
MariaDB 10.4 reaches EOL (“End of Life”) on 18 June 2024. The recommended minimum is bumped to 10.5 for now, whose EOL is 24 June 2025.
Also removes the skip in tests to allow the tests to run on all branches with this change.
References:
* [https://mariadb.org/about/#maintenance-policy MySQL Support Policies]
* [https://make.wordpress.org/hosting/handbook/server-environment/#database Hosting team handbook: Server Environment: Database]
Follow-up to [55665], [52420], [53435], [54069], [54076].
Props peterwilsoncc, dd32, costdev, mukesh27, hellofromTonya.
Fixes#61458.
See #meta7679.
git-svn-id: https://develop.svn.wordpress.org/trunk@58432 602fd350-edb4-49c9-b593-d223f7449a82
As a follow-up to [58430], this makes another locale available during the e2e tests, allowing testing of scenarios that require loading translations in the future.
See #61240.
git-svn-id: https://develop.svn.wordpress.org/trunk@58431 602fd350-edb4-49c9-b593-d223f7449a82
Sometimes errors only occur in unusual code paths such as the maintenance mode or installation screens. Due to lack of tests for these scenarios in core, such errors are usually only noticed very late. This change adds new end-to-end (e2e) tests to prevent regressions in the following areas:
- Maintenance mode (presence of a `.maintenance` file)
- Fatal error handler (simulated with an mu-plugin that causes an error)
- Installation screen (verifying full installation flow & that there are no database errors)
Thanks to these tests, an issue was already found and addressed in the default `wp_die` handler, as `wp_robots_noindex_embeds` and `wp_robots_noindex_search` used to cause PHP warnings due to `$wp_query` not existing.
In the future, these tests can be extended to also test scenarios like localized error pages via `wp_load_translations_early()`.
Fixes#61240.
git-svn-id: https://develop.svn.wordpress.org/trunk@58430 602fd350-edb4-49c9-b593-d223f7449a82
Uses `read_json_file` to access cached file if it exists instead of using `wp_json_file_decode` directly.
Props oandregal, aaronrobertshaw, joemcgill, ramonopoly, isabel_brison.
See #61451.
git-svn-id: https://develop.svn.wordpress.org/trunk@58428 602fd350-edb4-49c9-b593-d223f7449a82
In [5983], a call to `clean_term_cache()` was removed from `wp_set_object_terms()`. Since then, the `$term_ids` array that had been populated inside one of the `foreach` loops before being passed to the removed `clean_term_cache()` call has not been used.
This change removes the unused `$term_ids` variable.
Follow-up to [5983].
Props dlh, mukesh27.
Fixes#61456.
git-svn-id: https://develop.svn.wordpress.org/trunk@58427 602fd350-edb4-49c9-b593-d223f7449a82
Includes removing box shadow when the “Link image to home” setting is enabled.
Follow-up to [43800].
Props sabernhardt, nkeller15, karmatosed, hmbashar, rajinsharwar, huzaifaalmesbah, shailu25.
Fixes#58474.
git-svn-id: https://develop.svn.wordpress.org/trunk@58426 602fd350-edb4-49c9-b593-d223f7449a82
When saving options from the Settings page, include the `'ping_sites'` option in the allowed "writing" options list only when the `'blog_public'` option is `'1'`.
Fixes a PHP 8.1 and above "null to non-nullable" deprecation notice in `sanitize_option()` ([https://core.trac.wordpress.org/browser/trunk/src/wp-includes/formatting.php?annotate=blame#L4952 which happens when here] as part of [22255]):
{{{
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in .../wp-includes/formatting.php
}}}
**Explanation**
[https://developer.wordpress.org/apis/options/#writing Per the documentation], the `ping_sites` option requires the `'blog_public'` option to have a value of `'1'` and must be a `string` data type. `null` is not valid for this option.
The relationship between the 2 options shows itself in the `options-writing.php` code ([https://core.trac.wordpress.org/browser/tags/6.5.4/src/wp-admin/options-writing.php#L233 shown here] and in [4326]), as the `textarea#ping_sites` only renders when `'1' === get_option( 'blog_public' )`.
**What happens if `'blog_public'` is not `'1'`?**
The `'ping_sites'` option will not be a field on the page. Upon saving:
* HTTP POST (`$_POST`) does not include `'ping_sites'`.
* Before this commit:
* The [https://core.trac.wordpress.org/browser/trunk/src/wp-admin/options.php#L333 option's value was set to] `null` before being passed to `update_option()`.
* `update_option()` invokes `sanitize_option()`.
* A `null` value for the `'ping_sites'` case was passed to `explode()`, which threw a deprecation notice on PHP 8.1 and above.
* With this commit, the `'ping_sites'` option is no longer included in the allow list and thus will not be passed to `update_options()` > `sanitize_option()` > `explode()`.
Follow-up to [22255], [12825], [4326], [949].
Props kitchin, SergeyBiryukov, swissspidy, devmuhib, rajinsharwar, hellofromTonya.
Fixes#59818.
git-svn-id: https://develop.svn.wordpress.org/trunk@58425 602fd350-edb4-49c9-b593-d223f7449a82
In [58418] a test was added without the `test_` prefix in its function
name, and because of that, it wasn't run in the test suite.
The prefix has been added to ensure that it runs.
In the original patch, due to a logical bug, a recursive loop to
transform the inside contents of the bogus comments was never run
more than once. This has been fixed.
This patch also includes one more case where `kses` wasn't
properly detecting the bogus comment state, and adds a test case
to cover this. It limits itself to some but not all constructions
of invalid markup declaration so that it doesn't conflict with
existing behaviors around those and other kinds of invalid comments.
Props ellatrix, dmsnell.
See #61009.
Follow-up to [58418].
git-svn-id: https://develop.svn.wordpress.org/trunk@58424 602fd350-edb4-49c9-b593-d223f7449a82
Adds custom CSS to the block style variation rules output by `get_styles_for_block` in class `WP_Theme_JSON`.
Props isabel_brison, aaronrobertshaw.
Fixes#61425.
git-svn-id: https://develop.svn.wordpress.org/trunk@58421 602fd350-edb4-49c9-b593-d223f7449a82
When `wp_kses_split` processes a document it attempts to leave HTML comments
alone. It makes minor adjustments, but leaves the comments in the document in
its output. Unfortunately it only recognizes one kind of HTML comment and
rejects many others.
This patch makes a minor adjustment to the algorithm in `wp_kses_split` to
recognize and preserve an additional kind of HTML comment: closing tags with
an invalid tag name, e.g. `</%dolly>`.
These invalid closing tags must be interpreted as comments by a browser.
This bug fix aligns the implementation of `wp_kses_split()` more closely
with its stated goal of leaving HTML comments as comments.
It doesn't attempt to fully fix the mis-parsed comments, but it does propose a
minor fix that hopefully won't break any existing code or projects.
Developed in https://github.com/WordPress/wordpress-develop/pull/6395
Discussed in https://core.trac.wordpress.org/ticket/61009
Props ellatrix, dmsnell, joemcgill, jorbin, westonruter, zieladam.
See #61009.
git-svn-id: https://develop.svn.wordpress.org/trunk@58418 602fd350-edb4-49c9-b593-d223f7449a82
This commit is a clean revert of r58415 as tests seem to now be failing with this change. Likely the test needs an update as well to accomodate the new successful version check.
Follow-up to [60798].
Props jorbin, hellofromTonya.
See #60798.
git-svn-id: https://develop.svn.wordpress.org/trunk@58417 602fd350-edb4-49c9-b593-d223f7449a82
This fixes some autoload values that were updated in [58105] that used the database values of `"on"` and `"off"` instead of the boolean values `true` and `false` when being passed to `add|update_option()`.
Props joemcgill, desrosj, rajinsharwar.
Fixes#61045. See #42441.
git-svn-id: https://develop.svn.wordpress.org/trunk@58416 602fd350-edb4-49c9-b593-d223f7449a82
Previously `remove_pdf_alpha_channel()` used `Imagick::getVersion()` to validate the environment is capable of handling alpha. This was the incorrect function to use to check the module version as it will only provide the ImageMagick API version. This patch adjusts to instead use `phpversion()` as this is the correct method to get the Imagick version needed to determine alpha compatibility. This fixes a number of host tests that have been correctly failing on subsets of environments. Serendipidously, sometimes the API version was high enough to avoid shining light on this problem.
Props swissspidy, joedolson, antpb.
Fixes#60798.
git-svn-id: https://develop.svn.wordpress.org/trunk@58415 602fd350-edb4-49c9-b593-d223f7449a82
Replaces `trigger_error()` with `wp_trigger_error()`.
The usage of `wp_trigger_error()` avoids generating `E_USER` family errors unless `WP_DEBUG` is on. In doing so, users should not see these messages in normal production.
Notes:
* Removes `E_USER_NOTICE` when passed as an argumnent, as it's the default error level.
* An empty string is passed for the function name when its name is already in the error message or does not add value to the error message.
* Externally maintained libraries are not included.
Follow-up to [55204], [25956], [29630], [38883], [52062], [52049], [54272], [38883], [55245], [51599], [14452], [38883], [24976].
Props prasadkarmalkar, rajinsharwar, thelovekesh, hellofromTonya, swissspidy.
Fixes#59652.
git-svn-id: https://develop.svn.wordpress.org/trunk@58409 602fd350-edb4-49c9-b593-d223f7449a82