In WordPress 5.8 we added the ability to only load styles for blocks when these blocks are rendered. However, these optimizations left out block-styles that get added using the register_block_style() function/API.
Props aristath, gziolo.
Merges [51471] to the 5.8 branch.
Fixes#53616.
Built from https://develop.svn.wordpress.org/branches/5.8@51696
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This avoids a fatal error on PHP 8 caused by passing a zero value to `fread()` as the `$length` argument, which must be greater than zero.
This commit also amends the previous solution for similar issues elsewhere in the file to ensure consistent type for string values, instead of changing the type from `string` to `bool` when trying to read from an empty file.
Follow-up to [50355].
Props DavidAnderson, jrf, SergeyBiryukov.
Merges [51686] to the 5.8 branch.
Fixes#54036.
Built from https://develop.svn.wordpress.org/branches/5.8@51694
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `serializeAttributes()` function in JavaScript uses `JSON.stringify`, which does not encode slashes and unicode characters by default. This resulted in the PHP serialization through `json_encode()` producing different results.
This also switches from `json_encode()` to `wp_json_encode()` to prevent failures when any non UTF-8 characters are included.
Props kevinfodness, SergeyBiryukov, timothyblynjacobs.
Merges [51674] to the 5.8 branch.
Fixes#53936.
Built from https://develop.svn.wordpress.org/branches/5.8@51681
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the correct formatting detailed in the Docker `compose` documentation examples and helps to avoid ambiguities in the yaml parser when values that may cause warnings.
Props pbrearne, ocean90, johnbillion, desrosj.
Merges [51673] to the 5.8 branch.
Fixes#53820.
Built from https://develop.svn.wordpress.org/branches/5.8@51680
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Increase the number of media items displayed per page from 40 to 80 to improve the experience for users navigating the library on sites with a large quantity of media in the library.
Props AlGala, antpb, hellofromTonya, joedolson, SergeyBiryukov, wb1234, peterwilsoncc.
Merges [51632] to the 5.8 branch.
Fixes#53827.
Built from https://develop.svn.wordpress.org/branches/5.8@51643
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Reduces the right margin of the media library modal on small and medium width screens to remove excess white-space. On very narrow screens this was preventing the media icons from displaying.
Props andraganescu, desrosj, joedolson, moch11, mukesh27, sabernhardt, SergeyBiryukov, zieladam, peterwilsoncc.
Merges [51631] to the 5.8 branch.
Fixes#53679.
Built from https://develop.svn.wordpress.org/branches/5.8@51642
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Hide the browser's native radio button on the custom background position selector in the Customizer and the legacy background screen. This fixes an issue causing both to display.
Props mukesh27, ravipatel, sabernhardt, walbo, peterwilsoncc.
Merges [51637] to the 5.8 branch.
Fixes#53803.
Built from https://develop.svn.wordpress.org/branches/5.8@51640
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, the original "404" template key was lost when "Default template" is merged into the available templates array, as the `array_merge()` function renumbers numeric keys. Later, when we merge templates on the client side, this caused duplicate "404" templates to appear in the dropdown.
By replacing the `array_merge()` call with `array_replace()`, we make sure to keep the original numeric keys.
Props Mamaduka, Toro_Unit, youknowriad, SergeyBiryukov.
Merges [51595] to the 5.8 branch.
Fixes#53898.
Built from https://develop.svn.wordpress.org/branches/5.8@51620
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prevent the bulk-select option from displaying when adding a new menu. This also prevents the option from displaying when an administrator first visits the menu page and no menus are set.
Props dlh, sabernhardt, peterwilsoncc.
Merges [51539] to the 5.8 branch.
Fixes#53654.
Built from https://develop.svn.wordpress.org/branches/5.8@51596
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add a check to `wp_add_iframed_editor_assets_html()` confirming the edit post screen is using the block-editor before including block-editor specific JavaScript. For the classic and other editors the function returns early without any output.
Props swissspidy, desrosj, peterwilsoncc.
Merges [51540] to the 5.8 branch.
Fixes#53696.
Built from https://develop.svn.wordpress.org/branches/5.8@51593
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This avoids a "Table `wp_options` doesn't exist" database error when trying to create a nonce for password reset button.
When installing and using database-saved salts, `wp_create_nonce()` causes database errors as `wp_salt()` attempts to insert into the not-yet-created options table. Since authentication is not available during installation, we can safely skip creating a nonce.
Follow-up to [39684], [50129].
Props schlessera, swissspidy, sanketchodavadiya, hellofromTonya, SergeyBiryukov.
Merges [51525] to the 5.8 branch.
Fixes#53830.
Built from https://develop.svn.wordpress.org/branches/5.8@51546
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
While this has no effect on void elements in HTML5, it fixes a minor inconsistency with the rest of core.
Follow-up to [47493], [48834], [50556], [51418].
Props radixweb, ankitmaru, TobiasBg, sabernhardt, audrasjb, SergeyBiryukov.
Merges [51473] to the 5.8 branch.
Fixes#53716.
Built from https://develop.svn.wordpress.org/branches/5.8@51506
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Version bump three bundled themes to avoid file not found and fatal errors introduced for child themes during the 5.8 release cycle.
* Twenty Ten: Version 3.5 (fatal error & 404)
* Twenty Eleven: Version 3.9 (404)
* Twenty Twelve: Version 3.5 (404)
These updates will be released mid 5.8.1 cycle due to the severity of the issues.
Follow up to [51482,51483].
Props dd32, peterwilsoncc.
Merges [51486] to the 5.8 branch.
Fixes#53777.
Built from https://develop.svn.wordpress.org/branches/5.8@51489
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
By using `get_template_directory_uri()` instead of `get_stylesheet_directory_uri()`, we make sure to include the images from the parent theme.
This avoids displaying missing images in block patterns when using a child theme of Twenty Ten, Twenty Eleven, or Twenty Twelve.
Follow-up to [51033], [51103], [51106].
Props audrasjb, SergeyBiryukov.
Merges [51483] to the 5.8 branch.
Fixes#53769.
Built from https://develop.svn.wordpress.org/branches/5.8@51488
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
By using `get_template_directory()` instead of `get_stylesheet_directory()`, we make sure to include the `block-patterns.php` file from the parent theme.
This avoids a PHP fatal error when using a child theme of Twenty Ten.
Follow-up to [51106].
Props ryelle, sabernhardt, loranrendel, SergeyBiryukov.
Merges [51482] to the 5.8 branch.
Fixes#53752.
Built from https://develop.svn.wordpress.org/branches/5.8@51487
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This includes three minor updates to generated CSS files:
- A single `-webkit-` prefix is removed for `min-width`, which was required for Safari <= 10.1 (0.06% total global usage). WordPress only supports the last two versions.
- 2 instances where the `-o-` prefix are added for `tab-size`. This appears to be for Opera Mobile, which has creeped back over the 1% global usage.
Props peterwilsoncc, jorbin, desrosj.
Merges [51456] to the 5.8 branch.
Fixes#53686.
Built from https://develop.svn.wordpress.org/branches/5.8@51458
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This includes:
- Suggestion List: Check if a node exists to scroll into view.
- Autocomplete: reset state for empty text.
- Adds auxiliary class names for editor styles in the widgets editor.
- Extract snackbars into a separate component.
- Rich text: run input rules after composition end.
- iframe: load inline styles.
- Multi select: select all: restore ref callback.
- Writing flow: allow select all from empty selection.
- Post Excerpt: Fix excerpt_more filter conflict and remove wordCount attribute.
- Add the percent unit to the default units in Core.
Props desrosj, youknowriad.
Merges [51443] to the 5.8 branch.
Fixes#53397.
Built from https://develop.svn.wordpress.org/branches/5.8@51445
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
More testing has revealed that the `image_editor_output_format` filter has some interesting edge cases that developers should be aware of when electing to use this filter (see #53667 and #53668).
Because this is a new filter that was intended to be used for experimenting with different ways to handle generating image sizes and has not yet been adopted in the wild, expanding the inline documentation is an acceptable temporary solution while these edge cases are explored further and addressed.
Props mikeschroder, antpb, desrosj, adamsilverstein, ianmjones.
Merges [51442] to the 5.8 branch.
See #53667, #53668, #35725.
Built from https://develop.svn.wordpress.org/branches/5.8@51444
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes a bug where widgets are unintentionally moved to the `wp_inactive_widgets` sidebar when batch updates occur through the REST API.
When batch requests are processed, only `$_wp_sidebars_widgets` is updated by previous calls to `WP_REST_Widgets_Controller::create_item()`. `$sidebars_widgets` is not aware of the new widget’s intended location, and `retrieve_widgets()` mistakenly flags the widget as inactive.
Calling `wp_get_sidebars_widgets()` before `retrieve_widgets()` ensures both global variables match and is intended as a temporary fix until the root cause of the problem can be fixed.
Props zieladam, htmgarcia, timothyblynjacobs.
Merges [51432] to the 5.8 branch.
Fixes#53657.
Built from https://develop.svn.wordpress.org/branches/5.8@51439
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51050 1a063a9b-81f0-0310-95a4-ce76da25c4cd