This also adds support for the viewScript for blocks fixing
the PDF preview for file blocks.
Props desrosj, gziolo.
See #53397.
git-svn-id: https://develop.svn.wordpress.org/trunk@51259 602fd350-edb4-49c9-b593-d223f7449a82
When E2E tests fail, test snapshots with more details about the failure are placed in this folder.
Props isabel_brison.
Fixes#53549.
git-svn-id: https://develop.svn.wordpress.org/trunk@51258 602fd350-edb4-49c9-b593-d223f7449a82
Make sure the `$sidebar` variable is defined and has at least one entry in the array, before adding the `.below-entry-meta` class to elements below the entry meta.
Previously, the theme expected sidebar markup to exist on the page if sidebars are defined, but that markup is missing since only the widget itself and headers/footers of the page are loaded in the iframe used to display legacy widgets (widgets added prior to WordPress 5.8).
Props Clorith, Boniu91, desrosj.
Fixes#53512.
git-svn-id: https://develop.svn.wordpress.org/trunk@51257 602fd350-edb4-49c9-b593-d223f7449a82
This should clarify the purpose of the function and what effect it has on block styles loading.
Props aristath, desrosj, jorbin, SergeyBiryukov.
See #53505.
git-svn-id: https://develop.svn.wordpress.org/trunk@51256 602fd350-edb4-49c9-b593-d223f7449a82
This fixes an issue where block stylesheets were being loaded even if they did not exist, causing 404 errors. The issue presented itself when the site was choosing to load block assets individually through the `should_load_separate_core_block_assets` filter hook.
This also fixes an issue where non-Core blocks would only be registered if they actually had asset files. This prevents developers from adding additional information to a style handle, such as inline styles through `wp_add_inline_style()`.
Props walbo, jorbin, aristath, desrosj, hellofromTonya.
Fixes#53375.
git-svn-id: https://develop.svn.wordpress.org/trunk@51254 602fd350-edb4-49c9-b593-d223f7449a82
This reduces the specificity of the CSS selector applying a dimming effect to images so that the new Duotone feature is properly applied to images.
Props walbo.
Fixes#53531.
git-svn-id: https://develop.svn.wordpress.org/trunk@51253 602fd350-edb4-49c9-b593-d223f7449a82
This splits up the site title for the Site Health tabs to make it more obvious what page a user is viewing, and which tab under that page. It also removes a possible source of warnings if a user tries accessing a tab that does not exist.
The introduction of this check for existing tabs also improves the accuracy of the active-tab indicator, ensuring the indicator shows up for the default tab, when no other tab has been selected.
Follow-up to [50764].
Props audrasjb, swissspidy.
Fixes#53535.
git-svn-id: https://develop.svn.wordpress.org/trunk@51252 602fd350-edb4-49c9-b593-d223f7449a82
Registered widgets that do not extend WP_Widget should appear in the
wp_inactive_widgets sidebar by default. Having the widgets REST API call
retrieve_widgets() before serving any request ensures that this will happen.
This is a similar fix to [51235].
Fixes#53534.
Props zieladam, timothyblynjacobs.
git-svn-id: https://develop.svn.wordpress.org/trunk@51248 602fd350-edb4-49c9-b593-d223f7449a82
This wraps the inner-content of the Site Health dashboard widget to give a unique target for CSS selectors, restoring the ability to collapse the widget.
The initial implementation targeted the `.inside` class used by all widgets to apply styling to the widget content, but this prevented the widget from being collapsed, as it added grid-styles which other widgets do not use, overriding the usual behavior when toggling widget visibility.
Follow-up to [50833].
Props alanjacobmathew, walbo.
Fixes#53521.
git-svn-id: https://develop.svn.wordpress.org/trunk@51247 602fd350-edb4-49c9-b593-d223f7449a82
This matches the behavior that has been in place in the gutenberg plugin.
The idea is that this makes the editor match the frontend by default for these themes.
If they use a custom font, they'll have to provide it for the editor as editor styles.
Props nosolosw.
git-svn-id: https://develop.svn.wordpress.org/trunk@51240 602fd350-edb4-49c9-b593-d223f7449a82
This ensures backwards compatibility for code expecting this field to be present.
Props strategio, noisysocks, spacedmonkey.
See #53452.
git-svn-id: https://develop.svn.wordpress.org/trunk@51239 602fd350-edb4-49c9-b593-d223f7449a82
This avoids having to interact with the filesystem and ensures browser and proxy caches are only cleared when the file is actually updated.
Props peterwilsoncc, ryelle, aristath, SergeyBiryukov.
Fixes#53502.
git-svn-id: https://develop.svn.wordpress.org/trunk@51236 602fd350-edb4-49c9-b593-d223f7449a82
This fixes issues where sidebars would be unexpectedly missing from the new widgets screen. Running retrieve_widgets syncs sidebars that were registered after the last theme switch.
Props walbo, hellofromTonya, noisysocks.
Fixes#53489.
git-svn-id: https://develop.svn.wordpress.org/trunk@51235 602fd350-edb4-49c9-b593-d223f7449a82
This fixes a regression introduced in [50996] where sites that have been opted-out of the block-based widget editor experienced an “Invalid value.” error when adding a new widget to a sidebar in the Customizer.
This was caused by the early return value was changed to `null` from `$value` when set to an empty `array`, resulting in the widget being evaluated as invalid elsewhere.
Props jamesros161, caseymilne, naoki0h, ixkaito, zieladam, noisysocks, hellofromTonya.
Fixes#53479.
git-svn-id: https://develop.svn.wordpress.org/trunk@51232 602fd350-edb4-49c9-b593-d223f7449a82
This fixes a bug where the “Move To” dialogue was empty when a theme has multiple widget areas.
Props kevin940726, noisysocks, hellofromTonya.
Fixes#53487.
git-svn-id: https://develop.svn.wordpress.org/trunk@51228 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a "Call to undefined method" fatal error when running the tests with PHPUnit 5.4.x, which WordPress still supports as the minimum version.
Follow-up to [48945], [48947].
See #52625.
git-svn-id: https://develop.svn.wordpress.org/trunk@51226 602fd350-edb4-49c9-b593-d223f7449a82
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 [51079], [51198].
See #52482, #52625, #53397.
git-svn-id: https://develop.svn.wordpress.org/trunk@51225 602fd350-edb4-49c9-b593-d223f7449a82
Fix a misnamed variable introduced in [51145]. Change `$query_args` to correctly defined variable `$query`.
Follow-up to [51145].
props desrosj, audrasjb.
Fixes#50105.
git-svn-id: https://develop.svn.wordpress.org/trunk@51224 602fd350-edb4-49c9-b593-d223f7449a82
r51211 accidentally introduced a fatal error for Multisite instances with `ms_files_rewriting` enabled. Reverting removes the error, and the original purpose of the commit can be solved in another way.
Props otto42, barry, ryelle, azaozz.
Fixes#53492. See #53475.
git-svn-id: https://develop.svn.wordpress.org/trunk@51223 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that not only the array values being compared are equal, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()`, `assertSameSets()`, or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable.
Follow-up to [40631], [41132], [48939], [51137].
See #52482, #52625.
git-svn-id: https://develop.svn.wordpress.org/trunk@51220 602fd350-edb4-49c9-b593-d223f7449a82
Removes temporary gutenberg_ functions which were required by the Legacy Widget
block until the Legacy Widget block was updated in [51149].
Follows [50996].
Fixes#53441.
Props spacedmonkey.
git-svn-id: https://develop.svn.wordpress.org/trunk@51219 602fd350-edb4-49c9-b593-d223f7449a82
The register_widget function can be called with a class name or a class
instance. Once called with a class instance, the class instance is converted to
hash as used key in array.
Props spacedmonkey, zieladam.
git-svn-id: https://develop.svn.wordpress.org/trunk@51216 602fd350-edb4-49c9-b593-d223f7449a82
This better aligns with developer expectations, as `add_theme_support()` and `remove_theme_support()` are meant to be called within functions attached to the `after_setup_theme` hook.
This also adds the `widgets-block-editor` feature to the docblock for `add_theme_support()`.
Props kevin940726, caseymilne, jamesros161, noisysocks, Mamaduka, audrasjb, zieladam, hellofromTonya, desrosj.
Fixes#53424.
git-svn-id: https://develop.svn.wordpress.org/trunk@51214 602fd350-edb4-49c9-b593-d223f7449a82
Incorrect variable names were leading to unreachable conditional statements.
Follow up to [51149].
Props johnbillion, mukesh27.
See #53458.
git-svn-id: https://develop.svn.wordpress.org/trunk@51213 602fd350-edb4-49c9-b593-d223f7449a82
In [51146], the `core-js` package replaced the deprecated `@babel//polyfill` one. The `core-js` package builds `wp-polyfill` from a configuration provided by `@wordpress/babel-preset-default` instead of copying a one size fits all polyfill.
That change caused an issue where plugins and themes relying on the `regenerator-runtime` script being included in the `wp-polyfill.js` file encountering fatal JavaScript errors.
This adds the `regenerator-runtime` package to Core and registers it as a dependency for `wp-polyfill`. While Core does not require `regenerator-runtime`, it will allow for a smoother transition to using `core-js`.
This dependency will be removed in a future version of WordPress, so developers are encouraged to add `regenerator-runtime` as a dependency for any custom script that requires it.
Follow up to [51146].
Props gziolo, herregroen, jeherve, hellofromtonya, peterwilsoncc.
Fixes#52941.
git-svn-id: https://develop.svn.wordpress.org/trunk@51212 602fd350-edb4-49c9-b593-d223f7449a82
The class has been heavily modified from the original source, so the copyright can be modified to simply reference the original author’s work. The carry forward of the copyright and original code is implied.
Follow up to [50993-50995,51007,51020,51029].
Props SergeyBiryukov, cbringmann, chanthaboune, desrosj.
Fixes#41683.
git-svn-id: https://develop.svn.wordpress.org/trunk@51210 602fd350-edb4-49c9-b593-d223f7449a82