This avoids a deprecation notice on PHP 8.1 caused by passing `null` instead of a string to `ltrim()` in `wpdb::check_safe_collation()`, and maintains the current behaviour.
Follow-up to [30345], [32162], [33455].
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51396
git-svn-id: http://core.svn.wordpress.org/trunk@51007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Add missing short description for the function.
* Correct function names in `_doing_it_wrong()` calls.
* Document the usage of `$wp_scripts` and `$wp_styles` globals.
* Update syntax for multi-line comment per the documentation standards.
Follow-up to [51387], [51388].
See #53437, #53569.
Built from https://develop.svn.wordpress.org/trunk@51390
git-svn-id: http://core.svn.wordpress.org/trunk@51001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In addition to skipping animations when a related style doesn't Exist, now checks to see if animation styles are Empty as well.
This resolves a case where the Gutenberg End to End tests were failing, due to running with animations disabled.
This change should also help some users who are intentionally overriding styles to remove animations.
See https://github.com/WordPress/gutenberg/issues/32024 for the original Gutenberg issue.
Props zieladam, isabel_brison, kevin940726, desrosj, mikeschroder.
Fixes#53562.
See #53542.
Built from https://develop.svn.wordpress.org/trunk@51389
git-svn-id: http://core.svn.wordpress.org/trunk@51000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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`.
See #53437.
Fixes#53569.
Props zieladam, spacedmonkey, TimothyBlynJacobs, andraganescu, dlh.
Built from https://develop.svn.wordpress.org/trunk@51388
git-svn-id: http://core.svn.wordpress.org/trunk@50999 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.
See #53437.
Props zieladam, spacedmonkey, TimothyBlynJacobs, andraganescu.
Built from https://develop.svn.wordpress.org/trunk@51387
git-svn-id: http://core.svn.wordpress.org/trunk@50998 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.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@51383
git-svn-id: http://core.svn.wordpress.org/trunk@50994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A warpper is the traditional home of a neditor. They generally are optimized for supporting the good quality content that a neditor requires to survive. Some warppers feel like they have been around forever but have laid a foundation for newer warppers. A specific Russian warppers is known for having a wide footprint and touching almost everything. Warppers were originally only found subversioned underground, but they have been able to GIT above ground in the last few years.
The number of warpers in the world is small, but without them the neditor would never survive.
See [23105], [51375], #53604.
Props SergeyBiryukov.
Built from https://develop.svn.wordpress.org/trunk@51378
git-svn-id: http://core.svn.wordpress.org/trunk@50989 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.
Fixes#53612.
Built from https://develop.svn.wordpress.org/trunk@51377
git-svn-id: http://core.svn.wordpress.org/trunk@50988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Follow up to [51348].
Props aristath, jorbin.
See #53604.
Built from https://develop.svn.wordpress.org/trunk@51375
git-svn-id: http://core.svn.wordpress.org/trunk@50986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When using the post editor with a bundled theme active, there will be a number of `console.info` notices printed to the browser’s console.
These notices are caused by block patterns containing outdated and deprecated versions of `core/*` blocks. Before rendering the blocks, they need to be updated, and this process outputs information to the console.
Props ntsekouras.
Fixes#53617.
Built from https://develop.svn.wordpress.org/trunk@51372
git-svn-id: http://core.svn.wordpress.org/trunk@50983 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.
Fixes#53458.
Built from https://develop.svn.wordpress.org/trunk@51369
git-svn-id: http://core.svn.wordpress.org/trunk@50980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously errors were not displayed or logged, but the original intention was only to prevent them from being displayed. Hiding them from logs makes problems like #53492 much harder to debug.
This makes the handling of errors in `ms-files` consistent with the REST API, `admin-ajax`, and XML-RPC.
Props iandunn, johnjamesjacoby.
Fixes#53493.
Built from https://develop.svn.wordpress.org/trunk@51358
git-svn-id: http://core.svn.wordpress.org/trunk@50967 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.
Props chanthaboune, kellychoffman, javiarce, ryokuhi, alanjacobmathew, desrosj.
See #52775.
Built from https://develop.svn.wordpress.org/trunk@51356
git-svn-id: http://core.svn.wordpress.org/trunk@50965 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.
Fixes#53606
Built from https://develop.svn.wordpress.org/trunk@51355
git-svn-id: http://core.svn.wordpress.org/trunk@50964 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.
Fixes#53576.
Built from https://develop.svn.wordpress.org/trunk@51352
git-svn-id: http://core.svn.wordpress.org/trunk@50961 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 overidden.
Props johnbillion, timothyblynjacobs.
Fixes#53593.
Built from https://develop.svn.wordpress.org/trunk@51349
git-svn-id: http://core.svn.wordpress.org/trunk@50958 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.
Props aristath.
Fixes#53604.
Built from https://develop.svn.wordpress.org/trunk@51348
git-svn-id: http://core.svn.wordpress.org/trunk@50957 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
See #53397.
Built from https://develop.svn.wordpress.org/trunk@51344
git-svn-id: http://core.svn.wordpress.org/trunk@50953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the `actions/setup-node` action to version 2.2.2 and takes advantage of the cache feature now built in. This removes the need for an additional step using `actions/cache` to cache NPM dependencies.
The cache key used will be `${{ runner.os }}-npm-${{ hashFiles('') }}`, which matches the recommendation in the `actions/cache` documentation and the key currently in use in the WordPress workflows.
Props gziolo.
Fixes#53584.
Built from https://develop.svn.wordpress.org/trunk@51341
git-svn-id: http://core.svn.wordpress.org/trunk@50950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `assertInternalType()` and `assertNotInternalType()` methods are deprecated in PHPUnit 8 and removed in PHPUnit 9.
While WordPress test suite currently only supports PHPUnit up to 7.5.x, this allows us to switch to newer assertions ahead of adding full support for PHPUnit 8+.
These methods introduced in PHPUnit 7.5 should be used as an alternative:
* `assertIsArray()`
* `assertIsBool()`
* `assertIsFloat()`
* `assertIsInt()`
* `assertIsNumeric()`
* `assertIsObject()`
* `assertIsResource()`
* `assertIsString()`
* `assertIsScalar()`
* `assertIsCallable()`
* `assertIsIterable()`
* `assertIsNotArray()`
* `assertIsNotBool()`
* `assertIsNotFloat()`
* `assertIsNotInt()`
* `assertIsNotNumeric()`
* `assertIsNotObject()`
* `assertIsNotResource()`
* `assertIsNotString()`
* `assertIsNotScalar()`
* `assertIsNotCallable()`
* `assertIsNotIterable()`
As WordPress currently uses PHPUnit 5.7.x to run tests on PHP 5.6, polyfills for these methods are now added to the `WP_UnitTestCase` class for PHPUnit < 7.5.
Props pbearne, jrf, dd32, SergeyBiryukov.
Fixes#53491. See #46149.
Built from https://develop.svn.wordpress.org/trunk@51331
git-svn-id: http://core.svn.wordpress.org/trunk@50940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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/trunk@51321
git-svn-id: http://core.svn.wordpress.org/trunk@50930 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.
Fixes#53494.
Built from https://develop.svn.wordpress.org/trunk@51309
git-svn-id: http://core.svn.wordpress.org/trunk@50918 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.
Fixes#53577.
Built from https://develop.svn.wordpress.org/trunk@51307
git-svn-id: http://core.svn.wordpress.org/trunk@50916 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].
See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51294
git-svn-id: http://core.svn.wordpress.org/trunk@50903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When querying multiple post types, check the `read_private_posts` capability for each post type when determining which post statuses to return. This ensures private posts appear in search results and archives for users permitted to read them.
Props leogermani, hellofromTonya, jeffpaul, peterwilsoncc.
Fixes#48556.
Built from https://develop.svn.wordpress.org/trunk@51276
git-svn-id: http://core.svn.wordpress.org/trunk@50885 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
This is the start of the WordPress 5.8 about page, introducing new content and a first pass of the new style.
Props chanthaboune, cbringmann, webcommsat, marybaum, melchoyce, shaunandrews, desrosj, ryelle, oglekler, yvettesonneveld, nalininonstopnewsuk, meher, femkreations, alanjacobmathew, courane01, annezazu, matveb, milana_cap, javiarce, ryokuhi, audrasjb.
See #52775.
Built from https://develop.svn.wordpress.org/trunk@51264
git-svn-id: http://core.svn.wordpress.org/trunk@50873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [51256], the documentation was improved, this further improves it. As scripts are not yet a part of what this function does, they are not mentioned explicitly. Assets is used so that the docs don't need a lot of improvements when scripts do come into play..
Props desrosj, SergeyBiryukov, Jorbin.
See #53505.
Built from https://develop.svn.wordpress.org/trunk@51263
git-svn-id: http://core.svn.wordpress.org/trunk@50872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates `register_block_style_handle()` to use the `version` value provided in the `$metadata` parameter for non-Core blocks (when present). This removes the requirement to use `filemtime()` to generate a unique version.
When `version` is not defined within `$metadata`, the script version will fallback to using the current version of WordPress.
The block version should be considered similar to the one specified by plugin developers within the header of the main plugin file.
Props hellofromTonya, gziolo, jorbin, desrosj, walbo, aristath.
Fixes#53507.
Built from https://develop.svn.wordpress.org/trunk@51262
git-svn-id: http://core.svn.wordpress.org/trunk@50871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
It includes:
- Add a label for screen reader in categories block gutenberg#33060
- Remove "is-dark-theme" rules from mixins. gutenberg#33058
- Adjust widget form margins in the new widget editor gutenberg#33040
- [Block Library - Query Loop]: Select first Query Loop found from pattern selection gutenberg#32737
See #53397.
Built from https://develop.svn.wordpress.org/trunk@51261
git-svn-id: http://core.svn.wordpress.org/trunk@50870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@51257
git-svn-id: http://core.svn.wordpress.org/trunk@50866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@51254
git-svn-id: http://core.svn.wordpress.org/trunk@50863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@51252
git-svn-id: http://core.svn.wordpress.org/trunk@50861 1a063a9b-81f0-0310-95a4-ce76da25c4cd