Commit Graph

44154 Commits

Author SHA1 Message Date
Sergey Biryukov
c7be2d875e Docs: Some documentation improvements for wp_check_widget_editor_deps():
* 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51390 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-09 10:49:15 +00:00
Mike Schroder
7de1b7c0ae Customizer: Skip animations when they have no duration.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51389 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-09 08:12:29 +00:00
Robert Anderson
f49d48fdcb Widgets: Warn when wp-editor script or wp-edit-post style is enqueued in widgets editor
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@51388 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-09 01:17:41 +00:00
Robert Anderson
5d9c398669 Editor: Merge conflicting wp.editor objects into single, non-conflicting object
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@51387 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-09 01:09:08 +00:00
Jorge Costa
6bd5962c7d Block Editor: Fix for theme.json: color.duotone and spacing.units should allow empty sets.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51383 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-08 19:30:18 +00:00
Sergey Biryukov
7f20da50e7 Coding Standards: Remove wrapping HTML tags from translatable strings.
This fixes a "Strings should not be wrapped in HTML" WPCS warning in help tabs for Export Personal Data and Erase Personal Data screens.

Follow-up to [50147].

See #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@51381 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-08 17:06:29 +00:00
Dominik Schilling
a0c4143f06 Script Loader: Update jQuery version to 3.6.0 following the update in [50520].
Props audrasjb.
See #52707.

git-svn-id: https://develop.svn.wordpress.org/trunk@51380 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-08 07:18:05 +00:00
Aaron Jorbin
61759be775 Fix merge info.
[51378] contained merge info it shouldn't and accidentally a line of code from one of those commits that another one had changed.

See #53604.
Unprops jorbin.



git-svn-id: https://develop.svn.wordpress.org/trunk@51379 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-07 22:46:40 +00:00
Aaron Jorbin
2de2287240 Posts: Fix Spelling in inline docs.
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.



git-svn-id: https://develop.svn.wordpress.org/trunk@51378 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-07 22:38:44 +00:00
Timothy Jacobs
c283bf2bb6 REST API: Ensure a sidebar's widgets property is a list.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@51377 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-07 19:34:33 +00:00
Jonathan Desrosiers
8c413885bd Posts: Allow the list of wrapper blocks to be filtered.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51375 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-07 19:09:41 +00:00
Jonathan Desrosiers
311d6f8f42 Bundled Themes: Update block patterns to match the latest versions of core/* blocks.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51372 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-07 17:29:48 +00:00
Jonathan Desrosiers
953e1c5f83 Tests: Add missed file update in [51370].
See #53497.

git-svn-id: https://develop.svn.wordpress.org/trunk@51371 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-07 15:54:40 +00:00
Jonathan Desrosiers
0834d01365 Themes: Remove mention of “FSE” in Core.
“FSE” themes are block themes.

Fixes #53497.

git-svn-id: https://develop.svn.wordpress.org/trunk@51370 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-07 15:48:13 +00:00
Jonathan Desrosiers
00fc6b5ecd Tests: Expand tests for get_block_editor_settings().
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51369 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-07 14:12:46 +00:00
Sergey Biryukov
73e24c997c Coding Standards: Fix WPCS issues in [51367].
This fixes an "Expected 1 space after comma in argument list; 2 found" error.

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51368 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-07 10:50:43 +00:00
Sergey Biryukov
e77691036d Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertSame( [number], count( ... ) )` with `assertCount()` to use native PHPUnit functionality.

Follow-up to [51335], [51337].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51367 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-07 10:32:56 +00:00
Peter Wilson
b1f0971ee3 Block Editor: Update packages with latest fixes for 5.8 RC2
Includes the following fixes:

- Query Block: Type validation of `WP_Query` parameters.

Props ntsekouras, stevehenty, peterwilsoncc, desrosj.
Fixes #53397.



git-svn-id: https://develop.svn.wordpress.org/trunk@51362 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 23:55:44 +00:00
Kelly Choyce-Dwan
380f6976d5 Help/About: Update placeholder links on About page.
Props SergeyBiryukov, audrasjb.
See #52775.



git-svn-id: https://develop.svn.wordpress.org/trunk@51359 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 22:03:43 +00:00
Ian Dunn
8a8f0149b5 Multisite: Log error/warnings/notices from ms-files.php.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@51358 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 20:20:51 +00:00
Kelly Choyce-Dwan
c00ea5f5f2 Help/About: Update the About section for 5.8.
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.



git-svn-id: https://develop.svn.wordpress.org/trunk@51356 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 18:37:16 +00:00
John Blackbourn
ef09cd88de Build/Test Tools: Add assertions to ensure version-controlled files are not modified during CI, and fix the grunt clean command.
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


git-svn-id: https://develop.svn.wordpress.org/trunk@51355 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 18:36:46 +00:00
John Blackbourn
49159c5fc3 Docs: Correct the @since tag for the user_erasure_fulfillment_email_headers filter.
See #44314, #53461


git-svn-id: https://develop.svn.wordpress.org/trunk@51353 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 18:16:52 +00:00
Jonathan Desrosiers
818e9075ce Themes: Remove inline comment that is not relevant in WordPress Core.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51352 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 18:13:38 +00:00
Jonathan Desrosiers
125ebb3d31 Tests: Update the wp-api-generated.js fixture.
Follow up to [51241].

Props johnbillion.
See #53606.

git-svn-id: https://develop.svn.wordpress.org/trunk@51351 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 15:58:38 +00:00
Jonathan Desrosiers
efb1b5946d REST API: Add the $request parameter to methods checking permissions.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51349 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 15:41:35 +00:00
Jonathan Desrosiers
0690170556 Posts: Prevent an empty excerpt when groups and nested column blocks are present.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51348 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 15:31:48 +00:00
Riad Benguella
dd332ea876 Block Editor: Update packages with latest fixes for 5.8 RC2
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@51344 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 14:36:26 +00:00
Jonathan Desrosiers
3e2ce5cbfa Bundled Themes: Correct customzier typo.
This was found in Twenty Twenty-One and Twenty Nineteen.

Props audrasjb, spytzo, sabernhardt.
Fixes #53598.

git-svn-id: https://develop.svn.wordpress.org/trunk@51343 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 14:01:42 +00:00
Jonathan Desrosiers
0b82b52049 I18N: Correct recurring lenghts typo.
Props mikaelmayer.
Fixes #53600.

git-svn-id: https://develop.svn.wordpress.org/trunk@51342 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 13:51:05 +00:00
Jonathan Desrosiers
0c25dca719 Build/Test Tools: Use caching built into actions/setup-node.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51341 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 13:12:13 +00:00
Sergey Biryukov
2a73ddeab0 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_object( ... ) )` with `assertIsObject()` to use native PHPUnit functionality.

Follow-up to [51331], [51335].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51337 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 12:31:19 +00:00
Sergey Biryukov
24479f2141 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_array( ... ) )` with `assertIsArray()` to use native PHPUnit functionality.

Follow-up to [51331].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51335 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 12:25:53 +00:00
Sergey Biryukov
67f31935d0 Tests: Move loading compatibility layers for PHPUnit 6+ and 7.5+ closer together.
Follow-up to [40536], [44701], [50986].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51333 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 11:33:27 +00:00
jorbin
7026369035 Update the IRC link from Freenode to Libera.chat.
Update follows the update to https://make.wordpress.org/support/handbook/appendix/other-support-locations/introduction-to-irc/.

Fixes #53590.
Props empatogen, audrasjb.


git-svn-id: https://develop.svn.wordpress.org/trunk@51332 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-05 19:30:02 +00:00
Sergey Biryukov
bca693b190 Build/Test Tools: Replace assertInternalType() usage in unit tests.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51331 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-05 17:21:53 +00:00
John Blackbourn
fee45f935c Docs: Miscellaneous docblock improvements.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@51330 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-05 15:46:40 +00:00
Sergey Biryukov
19751bd0d3 Docs: Correct description for the upgrader_pre_install filter.
Props ilovecats7.
Fixes #53546.

git-svn-id: https://develop.svn.wordpress.org/trunk@51329 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-04 10:05:33 +00:00
Sergey Biryukov
5324c6b4dd Docs: Add @since tags for WP_Theme class properties.
Document WordPress versions Twenty Twelve and later bundled themes were introduced in.

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@51328 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-04 09:57:02 +00:00
johnbillion
5383af8483 Docs: Add and correct examples of common names for various dynamic hooks.
See #53581


git-svn-id: https://develop.svn.wordpress.org/trunk@51327 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-03 21:41:02 +00:00
John Blackbourn
35cf314f9a Docs: Document common names for dynamic hooks relating to metadata.
See #53581


git-svn-id: https://develop.svn.wordpress.org/trunk@51326 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-03 21:31:13 +00:00
Sergey Biryukov
92b8387b4c Docs: Correct @see references for hooks in the get_option() description.
Follow-up to [51050].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51324 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-03 11:31:00 +00:00
Sergey Biryukov
f1d2680ed8 Bundled Themes: Correct @since tags for block patterns.
Follow-up to [49347], [49348], [49583], [49584], [49763], [51103].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51323 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-03 09:40:51 +00:00
Sergey Biryukov
f9279f497c Twenty Twenty: Add missing documentation for some filters.
Add missing `@since` tags for some functions.

Correct alignment of some `@param` tags.

Follow-up to [46271], [46278], [51304].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51322 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-03 09:13:48 +00:00
Aaron Jorbin
b97fe776da Remove unnecessary function_exists check in get_the_block_template_html
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@51321 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 21:51:54 +00:00
Jonathan Desrosiers
8477f505be Editor: Ensure global styles are loaded in the footer when loading core assets individually.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51309 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 18:46:58 +00:00
Jonathan Desrosiers
66d9364d39 Editor: Ensure the Query block pattern category is translatable.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51307 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 14:34:24 +00:00
Jonathan Desrosiers
d64fe64bbb Editor: Remove the experimental experimental-link-color feature.
This has been plugin only so far and should remain so.

Follow up to [50959].

Props nosolosw.
Fixes #53175.

git-svn-id: https://develop.svn.wordpress.org/trunk@51306 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 13:01:59 +00:00
Sergey Biryukov
7d72515899 Twenty Twenty-One: Add missing documentation for some filters.
Add missing `@since` tags for some functions.

Follow-up to [49216], [49220], [49854], [51294].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51304 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 08:56:06 +00:00
Sergey Biryukov
d7da5878ad Docs: Correct description for the $image parameter of the wp_save_image_file filter.
Follow-up to [27357], [48798], [51302].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@51303 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 07:10:29 +00:00