It is common that plugins erroneously have `wp-editor` or `wp-edit-post` as a
dependency in a script that is loaded in the new widgets editor. This is a smell
since both `@wordpress/editor` and `@wordpress/edit-post` assume the existence
of a global "post" object which the widgets editor does not have.
[51387] fixes the user-facing errors typically caused by this mistake, but we
can go a step further and warn developers about this by calling
`_doing_it_wrong()` when we detect that the `wp-editor` script or `wp-edit-post`
style is enqueued alongside `wp-edit-widgets` or `wp-customize-widgets`.
Props zieladam, spacedmonkey, TimothyBlynJacobs, andraganescu, dlh, noisysocks.
Merges [51388] to the 5.8 branch.
Fixes#53569. See #53437.
Built from https://develop.svn.wordpress.org/branches/5.8@51393
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `wp-editor` script (`@wordpress/editor` npm package) is exposed as
`window.wp.editor` in WP Admin. This causes problems, though, as many older
scripts expect to see the older `editor` script available at `window.wp.editor`.
The solution is to export all the members of the older `window.wp.editor` module
in the newer module to maintain backwards compatibility.
Props zieladam, spacedmonkey, TimothyBlynJacobs, andraganescu, noisysocks.
Merges [51387] to the 5.8 branch.
See #53437.
Built from https://develop.svn.wordpress.org/branches/5.8@51392
git-svn-id: http://core.svn.wordpress.org/branches/5.8@51003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit fixes an issue with the color.duotone & spacing.units in which empty values didn't override previous origins, resulting in that a theme couldn't provide an empty set for this via its theme.json.
Props nosolosw, youknowriad, aristath, jorgefilipecosta.
Merges [51383] to the 5.8 branch.
Fixes#53175.
Built from https://develop.svn.wordpress.org/branches/5.8@51386
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When a widget is removed from a sidebar, if it was removed from the middle of the list, the widgets property would become an object with numeric keys.
The sidebars controller now forces the widgets property to be a list.
Props walbo, timothyblynjacobs.
Merges [51377] to the 5.8 branch.
Fixes#53612.
Built from https://develop.svn.wordpress.org/branches/5.8@51385
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This improves the logic within excerpt_remove_blocks() to better handle innerBlocks. This prevents an empty excerpt from being returned when core/columns, core/column, and core/group blocks are present.
This issue has been surfaced in the Query Loop block, where excerpts can be set to display.
This introduces the excerpt_allowed_wrapper_blocks filter for controlling which blocks should be considered wrapper blocks.
Wrapper blocks and their nested contents are not stripped by excerpt_remove_blocks(), allowing their contents to appear in generated excerpts.
Backports [51348], [51375], [51378], and [51379] to the 5.8 branch.
Fixes#53604.
Props aristath, jorbin, SergeyBiryukov, desrosj.
Unprops jorbin.
Built from https://develop.svn.wordpress.org/branches/5.8@51382
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds unit tests to ensure `get_block_editor_settings()` properly maps some previously experimental features to their correct locations in the array of contextualized block editor settings returned by the function.
Follow up to [51149], [51213].
Props felipeelia, SergeyBiryukov.
Merges [51369] to the 5.8 branch.
Fixes#53458.
Built from https://develop.svn.wordpress.org/branches/5.8@51376
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes an inline comment block that was added when importing the `WP_Theme_JSON` class in [50959]. The comment is relevant to the code only when viewed within the context of the Gutenberg plugin.
Props nosolosw, jorbin, SergeyBiryukov.
Merges [51352] to the 5.8 branch.
Fixes#53576.
Built from https://develop.svn.wordpress.org/branches/5.8@51364
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add the images for About, Freedoms, and Privacy. Update the styles on all About section pages to match the About page style. Fix string issues, missing link wrapper, duplicate copy.
Also updates placeholder links on the page.
Props chanthaboune, kellychoffman, javiarce, ryokuhi, alanjacobmathew, desrosj, SergeyBiryukov, audrasjb.
Merges [51356] and [51359] to the 5.8 branch.
See #52775.
Built from https://develop.svn.wordpress.org/branches/5.8@51360
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Some tests and some commands that run during the build steps modify files that are under version control. This adds assertions to ensure that these files don't remain in a modified state after the test runs on CI.
This also fixes the `grunt clean` command which erroneously deletes `script-loader-packages.php`. This file is re-populated during the build, but deleting it during the clean is undesirable.
Merges [51355] to the 5.8 branch.
Fixes#53606
Built from https://develop.svn.wordpress.org/branches/5.8@51357
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds the `$request` parameter to the permissions_check() methods within `WP_REST_Widgets_Controller` and adds $request as an allowed parameter to the `permissions_check()` method within `WP_REST_Templates_Controller`.
Even when this parameter is not used by default, it should be implemented to support the class being extended and the method overridden.
Props johnbillion, timothyblynjacobs.
Merges [51349] to the 5.8 branch.
Fixes#53593.
Built from https://develop.svn.wordpress.org/branches/5.8@51350
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes the logic in `wp_enqueue_global_styles()` to ensure that global styles are loaded in the footer when a site opts-in to loading Core block assets individually.
This fixes a bug where styles defined in `themes.json` are not respected.
Props walbo, nosolosw, mcsf, aristath, desrosj, jorbin.
Merges [51309] to the 5.8 branch.
Fixes#53494.
Built from https://develop.svn.wordpress.org/branches/5.8@51347
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes the following fixes:
- [Block Library]: Less warnings when blocks try to render themselves.
- Reset z-index on focused widget form
- Refactor appender margin.
- Fix slash inserter for widgets screen.
- Widget screens: set html block as freeform content handler.
- Widget Block: widget_id is undefined when a widget is placed.
- Add <CopyHandler> to WidgetAreasBlockEditorProvider
- Add width: 100% to components-base-control inside wp-block-legacy-widget
- [Widgets editor] Replace the "technical" error notice a more user-friendly one
- Fix legacy widget height overflow
- Fix "Select all" behavior in the editor
- Increase specificity of the NoPreview CSS rules to avoid conflicts with theme styles
- Fix move to widget area checkmark
- Replace legacy widget icon with its new version
- [Block Library - Query Loop]: Set default block variations not to inherit from global query
Merges [51344] to the 5.8 branch.
Fixes#53397.
Built from https://develop.svn.wordpress.org/branches/5.8@51346
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Merges [51321] to the 5.8 branch. Reviewed by SergeyBiryukov.
WordPress can be confident that WordPress functions exist.
I forgot this function existed.
And I thought that it would fatal, but it didn't
And it was so nice
So peaceful and quiet
I forgot this function existed
It isn't love, it isn't hate, it's just indifference
Introduced in [51003].
Props walbo.
Fixes#53578. See #53176.
Built from https://develop.svn.wordpress.org/branches/5.8@51325
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- Remove unnecessary `@access` tags that were previously removed from core.
- Remove an empty line between `@param` and `@return` tags.
- Correct alignment of `@param` tags.
Follow-up to [41161], [41162], [41168], [49216], [49220].
Props SergeyBiryukov.
Merges [51294] to the 5.8 branch.
See #52628, #53461.
Built from https://develop.svn.wordpress.org/branches/5.8@51319
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Because the `__()` translation function was used here, the Query block pattern category string is not translatable. `_x()` is the correct function here as that passes the second parameter as context and not text domain.
Follow up to [50948].
Props walbo.
Merges [51307] to the 5.8 branch.
Fixes#53577.
Built from https://develop.svn.wordpress.org/branches/5.8@51308
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes a PHP notice caused by the `viewScript` for the `core/file` block having `.min.js` instead of just `.js`.
`register_block_script_handle()` was incorrectly looking for `view.min.asset.php`, which does not exist, and caused the `_doing_it_wrong()` notice.
This adds a check for `.min.js` in the `viewScript` field of `block.json` and corrects it to `.js` in order to match the expected pattern of `view.asset.php` until a more permanent fix can be created.
Follow up to [51259].
Props ipstenu, pbiron, peterwilsoncc.
See #53397.
Built from https://develop.svn.wordpress.org/trunk@51267
git-svn-id: http://core.svn.wordpress.org/trunk@50876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds a one-off notice to the dashboard in the event WordPress has automatically deactivated a plugin due to incompatibility with the new version of WordPress.
Introduces the new private function `deactivated_plugins_notice()` to display the notice in the dashboard. Introduces the new auto-loaded option `wp_force_deactivated_plugins` to store a list of automatically deactivated plugins; the option is used on both a site and network level.
Follow up to [51180].
Props desrosj, jorbin, azaozz, SergeyBiryukov, peterwilsoncc.
See #53432.
Built from https://develop.svn.wordpress.org/trunk@51266
git-svn-id: http://core.svn.wordpress.org/trunk@50875 1a063a9b-81f0-0310-95a4-ce76da25c4cd