This avoids an `array_keys() expects parameter 1 to be array, null given` PHP warning for the `query_vars` property in `WP::build_query_string()` when disabling request parsing via the `do_parse_request` filter.
Props dd32, SergeyBiryukov.
Fixes#55222.
Built from https://develop.svn.wordpress.org/trunk@52804
git-svn-id: http://core.svn.wordpress.org/trunk@52393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset removes the Live Preview link for block-based themes when installing for a zip archive, since the customizer is disabled by default for block themes.
Follow-up to [52353].
Props alanjacobmathew, hellofromTonya, antonvlasenko, ironprogrammer.
Fixes#54578.
Built from https://develop.svn.wordpress.org/trunk@52802
git-svn-id: http://core.svn.wordpress.org/trunk@52391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.
Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]
In PHP 8.1, if the home URL does not have a "host" component, it would lead to a `substr(): Passing null to parameter #1 ($string) of type string is deprecated` notice.
Changing the logic around and adding validation for the return type value of `wp_parse_url()` prevents that.
Follow-up to [48601], [51606], [51622], [51626], [51629], [51630].
Props dennisatyoast, jrf.
See #54730.
Built from https://develop.svn.wordpress.org/trunk@52799
git-svn-id: http://core.svn.wordpress.org/trunk@52388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This change makes sure only gallery content is returned by `get_post_galleries()`. It fixes an issue where non gallery block content was also returned by the function.
Props BinaryMoon, costdev, glendaviesnz.
Fixes#55203.
Built from https://develop.svn.wordpress.org/trunk@52797
git-svn-id: http://core.svn.wordpress.org/trunk@52386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Keyboard handlers were prevented from navigating attachments in input fields, but the key handler excluded readonly fields, like the media URL field. This could prevent exploring the URL using the keyboard.
Props jrivett, joemcgill, afercia.
Fixes#43202.
Built from https://develop.svn.wordpress.org/trunk@52792
git-svn-id: http://core.svn.wordpress.org/trunk@52381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This change adds a blue focus outline to the icon on plugin cards, for consistency with the text part of the link.
Props hitendra-chopda, SergeyBiryukov, afercia, themattroyal, imokol, sabernhardt, audrasjb.
Fixes#45209.
Built from https://develop.svn.wordpress.org/trunk@52790
git-svn-id: http://core.svn.wordpress.org/trunk@52379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The developer facing humor in these functions were from a different era of WordPress. Tolerance for in-jokes and other developer facing humor has decreased over the years. Terms like "pee" and "tinkle" may make some folks chuckle while for others it makes them uncomfortable.
Terminology of the past is being (or has been) re-evaluated to transform words into a language that are inclusive and welcome for all. This commit is part of that effort as it replaces.
Follow-up [13], [9255].
Props ricomoorman, tzipporahwitty, ironprogrammer, peterwilsoncc, jeremyfelt, Viper007Bond, rmccue, SergeyBiryukov, hellofromTonya.
Fixes#25615.
Built from https://develop.svn.wordpress.org/trunk@52789
git-svn-id: http://core.svn.wordpress.org/trunk@52378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.
Additionally, this commit moves the test function before the data provider, for consistency with other tests.
Follow-up to [46159], [46224].
See #54725.
Built from https://develop.svn.wordpress.org/trunk@52775
git-svn-id: http://core.svn.wordpress.org/trunk@52364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add a new function called `wp_cache_flush_runtime` to existing caching functions found in WordPress. This function allows users to flush the runtime (in-memory) cache, without flushing the entire persistent cache.
Props: Spacedmonkey, tillkruess, flixos90, adamsilverstein, SergeyBiryukov, barryhughes.
Fixes: #55080.
Built from https://develop.svn.wordpress.org/trunk@52772
git-svn-id: http://core.svn.wordpress.org/trunk@52361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Global styles duotone filters were not rendering in the post editor. This fixes that by adding `wp_global_styles_render_svg_filters` to the `in_admin_header` so it renders in the body before the editor.
Follow-up [52757].
Props ajlende, abhanonstopnewsuk.
Fixes#55190.
Built from https://develop.svn.wordpress.org/trunk@52768
git-svn-id: http://core.svn.wordpress.org/trunk@52357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds an additional guard to ensure the value of `$preset_metadata['value_key']` actually exists as a key in the `$preset` array. Fixes `Warning: Undefined array key` error.
Intentionally adds the check into the existing `isset()` as it's native to PHP, more efficient, and a good pattern.
Follow-up [52049].
Props jeherve, swissspidy, sergeybiryukov, jrf.
Fixes#55161.
Built from https://develop.svn.wordpress.org/trunk@52763
git-svn-id: http://core.svn.wordpress.org/trunk@52352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset is a backport for the following Gutenberg PRs:
- Fix duotone theme cache gutenberg#36236
- Fix duotone render in non-fse themes gutenberg#37954
- Duotone: Allow users to specify custom filters gutenberg#38442
Props oandregal, scruffian, Mamaduka.
See #55179.
Built from https://develop.svn.wordpress.org/trunk@52757
git-svn-id: http://core.svn.wordpress.org/trunk@52346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Restricts and grants access to only admin roles for the Navigation Menu UI screen, i.e. either directly through the URL wp-admin/edit.php?post_type=wp_navigation or via the Navigation block's "Manage menu" option (in the block's toolbar).
It resolves 2 issues:
- For non-block themes, fixes the issue where admins could not access the UI.
- For block themes, restricts access to only admin roles, i.e. non-admins no longer have access to the UI.
Non-admins will receive the "Sorry, you are not allowed to edit posts in this post type" error message.
Follow-up [52069], [52145], [52330], [52400].
Props ironprogrammer, costdev, noisysocks, talldanwp, hellofromTonya, manfcarlo, pyrobd.
Fixes#54889.
Built from https://develop.svn.wordpress.org/trunk@52755
git-svn-id: http://core.svn.wordpress.org/trunk@52344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit applies feedback given to commit 52741. It changes the new function name, the file where it is located, and improves its documentation and marks.
Follow-up to [52741].
Props hellofromtonya, swissspidy, oandregal.
See #55148.
Built from https://develop.svn.wordpress.org/trunk@52743
git-svn-id: http://core.svn.wordpress.org/trunk@52332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The dynamic block styles for layout and elements should be loaded in the head for block themes. While that should also be the case for classic themes, the current mechanism we use (render_block) does not allow us to do that, hence, this PR doesn't change anything for them and will be loaded the body.
Props oandregal, youknowriad, wpsoul.
Fixes#55148.
Built from https://develop.svn.wordpress.org/trunk@52741
git-svn-id: http://core.svn.wordpress.org/trunk@52330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, some logic was added to load the global stylesheet in the bottom of `<body>` for classic themes that opted-in into loading individual block styles instead of a single stylesheet for them all. At the time, block themes always loaded the global stylesheet in the `<head>`. When block themes landed in core during WordPress 5.9 this logic wasn’t updated to consider them, hence the global stylesheet loaded in the `<body>` for them. This changeset fixes this.
Props oandregal, aristath.
Fixes#55148.
Built from https://develop.svn.wordpress.org/trunk@52738
git-svn-id: http://core.svn.wordpress.org/trunk@52327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
#38231 added support for files fetched remotely to have their filename defined by the host using the `Content-Disposition` header. This would then take priority over the existing temporary file name created with `wp_tempnam()` earlier in the process.
The change unintentionally omitted the temporary directory path used during uploads, since the `wp_tempnam()` function would have added it previously, so that files with this header ended up being stored in the WordPress root folder, or wp-admin folder, when triggered by WP_Cron or user interactions respectively.
This change makes sure the file path includes the temporary directory location when the header is used.
Follow-up to [51939].
Props antonynz, azouamauriac.
Fixes#55109.
Built from https://develop.svn.wordpress.org/trunk@52734
git-svn-id: http://core.svn.wordpress.org/trunk@52323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since WordPress 5.9 you can set a view script for a block which is supposed to be only loaded on the front end. Unfortunately it's currently also loaded in the editor which can cause unexpected behaviour and also performance issues depending on the size of the scripts.
This is caused by the preloading of REST API routes via `block_editor_rest_api_preload()` which doesn't happen in an encapsulated process and so does pollute any global state like the one for scripts and styles.
Similar to the global `$post`, core now backups the globals `$wp_scripts` and `$wp_styles` and restores the backup after the preloading.
Props gziolo, ocean90.
Fixes#55151.
Built from https://develop.svn.wordpress.org/trunk@52733
git-svn-id: http://core.svn.wordpress.org/trunk@52322 1a063a9b-81f0-0310-95a4-ce76da25c4cd