4177 Commits

Author SHA1 Message Date
Timothy Jacobs
1de9c692f3 REST API: Retrieve latest widgets before loading sidebars.
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
2021-06-25 13:17:20 +00:00
Sergey Biryukov
67fc415084 Tests: Correct PHPUnit version requirement in tests using ::createPartialMock().
The method was introduced in PHPUnit 5.5, not 6.0.

Follow-up to [48945], [48947] [51226].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51234 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-25 10:38:23 +00:00
Jonathan Desrosiers
fc0c7a01f2 Widgets: Fix an “Invalid value” warning when adding a new widget in the Customizer.
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
2021-06-25 00:07:15 +00:00
Jonathan Desrosiers
3dc566ba89 Widgets: Add missing label and description to Customizer controls.
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
2021-06-24 19:19:57 +00:00
Sergey Biryukov
f5ae410c33 Tests: Require PHPUnit >= 6 in tests using ::createPartialMock().
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
2021-06-24 10:04:41 +00:00
Sergey Biryukov
735ecc0ba9 Tests: Use assertSame() in _wp_to_kebab_case() tests.
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
2021-06-24 06:51:54 +00:00
Sergey Biryukov
10111200c9 Tests: Replace assertEquals() with assertSameSets() in text widget tests.
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
2021-06-23 15:59:39 +00:00
Jonathan Desrosiers
1ec56ec5b5 Build/Test Tools: Add the regenerator-runtime script as a dependency to wp-polyfill.
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
2021-06-23 00:04:47 +00:00
Ian Dunn
83c7cad248 Block Editor: Move caching to endpoint for unique responses.
Now that the pattern API request includes the locale and version, the cache key needs to contain a hash of the query args.

Props ocean90, dd32, timothyblynjacobs
Fixes #53435


git-svn-id: https://develop.svn.wordpress.org/trunk@51208 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 21:23:19 +00:00
Felix Arntz
41c6786952 Media: Add lazy-loading support to block-based widgets.
This changeset adds the `wp_filter_content_tags()` function as a filter to `widget_block_content`.

Props spacedmonkey, walbo, daisyo.
Fixes #53463, #53464.


git-svn-id: https://develop.svn.wordpress.org/trunk@51207 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 21:22:27 +00:00
Sergey Biryukov
3e50f2861f Code Modernization: Use a consistent check for parent items in WP_Walker.
This affects the `::walk()`, `::paged_walk()`, and `::get_number_of_root_elements()` methods.

PHP 8 changes the way string to number comparisons are performed: https://wiki.php.net/rfc/string_to_number_comparison

In particular, checking if an empty string is equal to zero in PHP 8 evaluates to `false`, not `true`.

For the `WP_Walker` class, this resulted in an incorrect handling of parent items in a few methods.

By explicitly checking for an `empty()` value instead, we make sure the check works as expected in PHP 8 and earlier versions.

Follow-up to [35876], [48960], [49043], [49076].

Props sunxiyuan, aristath, SergeyBiryukov.
Fixes #53474.

git-svn-id: https://develop.svn.wordpress.org/trunk@51204 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 19:07:26 +00:00
Jonathan Desrosiers
31adfecbf3 Widgets: Add editor styles to the widgets block editor.
This updates the widgets screen to load the editor styles in the same way as the post editor. This combined with the package updates in [51198] and [51199] ensures that the blocks added to sidebars more accurately reflect what will be displayed on the front end of the site.

Props isabel_brison, noisysocks, andraganescu, audrasjb, jorbin, caseymilne, desrosj.
Fixes #53344. See #53388.

git-svn-id: https://develop.svn.wordpress.org/trunk@51200 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 13:32:42 +00:00
Jorge Costa
ab86a02401 Ports theme.json changes for beta 3.
- Add _wp_to_kebab_case function
- Add CSS Custom Properties within preset classes.

Props nosolosw.
See #53397.

git-svn-id: https://develop.svn.wordpress.org/trunk@51198 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 09:49:13 +00:00
Sergey Biryukov
d920d56923 Tests: Use more appropriate assertions in a few tests.
Follow-up to [34804], [41376], [50959], [51124].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51196 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 04:34:29 +00:00
Sergey Biryukov
c234527301 Tests: Use more appropriate assertions in clean_dirsize_cache() tests.
Follow-up to [49212], [49616], [49628], [49630].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51186 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-20 00:24:31 +00:00
Sergey Biryukov
4b7b089896 REST API: Decode single and double quote entities in widget names and descriptions.
Follow-up to [51174], [51175].

Props ocean90, ramonopoly.
Fixes #53407.

git-svn-id: https://develop.svn.wordpress.org/trunk@51183 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-18 15:51:26 +00:00
Sergey Biryukov
2816e8b876 Themes: Make sure get_file_data() recognizes headers prefixed by <?php tag.
This allows for using headers in the format of `<?php // Template Name: Something ?>`, which previously could not be recognized correctly.

Props dd32, m_uysl, thomas-vitale, boblinthorst.
Fixes #33387.

git-svn-id: https://develop.svn.wordpress.org/trunk@51182 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-18 14:02:44 +00:00
Sergey Biryukov
1f0cdc6f3b Tests: Correct svn:eol-style property for test data with CR line endings.
Follow-up to [703/tests], [704/tests], [46586].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51181 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-18 13:57:30 +00:00
Sergey Biryukov
855bbef616 REST API: Decode HTML entities in widget names and descriptions in widget types controller.
Follow-up to [50995].

Props ramonopoly, noisysocks, spacedmonkey, justinahinon, audrasjb, SergeyBiryukov.
Fixes #53407.

git-svn-id: https://develop.svn.wordpress.org/trunk@51174 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-17 11:28:55 +00:00
Sergey Biryukov
52e65717f9 Tests: Make some optional parameters required in unit tests for previous/next attachment links.
This resolves a "Deprecated: Required parameter follows optional parameter" notice on PHP 8.

Follow-up to [48794], [51122].

See #45708, #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51172 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-16 17:30:07 +00:00
Riad Benguella
0068f2646c Block Editor: Update the WordPress packages with the fixes for 5.8 beta 2.
This includes:

**Various**

 - Fix multi selection for nested blocks https://github.com/WordPress/gutenberg/pull/32536
 - Consistently show the drop indicator while dragging blocks https://github.com/WordPress/gutenberg/pull/31896
 - Fix horizontal drop indicator https://github.com/WordPress/gutenberg/pull/32589
 - Fix Safari flickering issue https://github.com/WordPress/gutenberg/pull/32581
 - Silence useSelect zombie bug errors https://github.com/WordPress/gutenberg/pull/32088

**Template Editor**

 - Clarify the template creation modal https://github.com/WordPress/gutenberg/pull/32427
 - Only add skip links for block templates https://github.com/WordPress/gutenberg/pull/32451

**Widgets Editor**

 - Add block breadcrumb https://github.com/WordPress/gutenberg/pull/32498 https://github.com/WordPress/gutenberg/pull/32528 https://github.com/WordPress/gutenberg/pull/32569
 - Saved deleted and restored widgets. https://github.com/WordPress/gutenberg/pull/32534
 - Fix unsaved changes detection https://github.com/WordPress/gutenberg/pull/32573
 - Fix button spacing in the header https://github.com/WordPress/gutenberg/pull/32585
 - Avoid extra undo levels https://github.com/WordPress/gutenberg/pull/32572
 - Move Legacy Widget block to the `@wordpress/widgets` package https://github.com/WordPress/gutenberg/pull/32501
 - Fix Social Links color inheritance https://github.com/WordPress/gutenberg/pull/32625
 - Use Button appender https://github.com/WordPress/gutenberg/pull/32580

**Global Styles (theme.json)**
 
 - Separate the presets per origin in the block editor settings https://github.com/WordPress/gutenberg/pull/32358 https://github.com/WordPress/gutenberg/pull/32622
 - Use CSS Custom Properties for the preset styles https://github.com/WordPress/gutenberg/pull/32627

**Performance**

 - Remove is-typing classname to improve typing performance https://github.com/WordPress/gutenberg/pull/32567

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.


git-svn-id: https://develop.svn.wordpress.org/trunk@51149 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 08:50:26 +00:00
Sergey Biryukov
132984c20f Tests: Fix typo in a retrieve_widgets() test name.
Correct parameter description for `data_wp_widget_get_field_name()`.

Follow-up to [34780], [41555].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51140 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-13 16:27:38 +00:00
Sergey Biryukov
376840b83c Tests: Fix typo in a get_bookmarks() test name.
Follow-up to [44546].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51139 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-12 15:47:08 +00:00
Sergey Biryukov
98c9ab835e Docs: Correct DocBlock formatting for some revision tests.
Follow-up to [50949], [51124].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@51138 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-11 12:34:09 +00:00
Sergey Biryukov
d4b2fae838 Tests: Use assertSameSets() in some newly introduced tests.
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 `assertSameSets()` or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable.

Follow-up to [48939], [49925], [50157], [50959], [50960], [50995], [51079].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51137 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-10 19:18:15 +00:00
Peter Wilson
5bee644258 Widgets: Improve unit tests for RSS Widget.
Prevent unit tests from making HTTP requests to wordpress.org. Specify URLs as https rather than http.

Follow up to [51107].

Props hellofromTonya.
Fixes #53278.


git-svn-id: https://develop.svn.wordpress.org/trunk@51136 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-09 23:50:14 +00:00
Sergey Biryukov
81e84e12e8 Tests: Ignore EOL differences in some tests using multiline string assertions.
Unix vs. Windows EOL style mismatches can cause misleading failures in tests using the heredoc syntax (`<<<`) or multiline strings as the expected result.

Follow-up to [48466], [50995], [51079].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51135 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-09 19:41:47 +00:00
Jonathan Desrosiers
c83d315d52 Build/Test Tools: Silence jQuery Migrate console warnings when running E2E tests.
These warnings will still be visible in the browser console. The majority of the warnings are coming from jQuery UI, which is still waiting for a new update to be released that is jQuery >= 3.0 friendly.

This change makes the E2E test results more readable without having to tread through the large number of warnings.

Props isabel_brison.
Fixes #52860.

git-svn-id: https://develop.svn.wordpress.org/trunk@51130 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-09 01:35:26 +00:00
Anthony Burchell
1c418298bf Privacy: Improve naming of user confimed action email filters.
The filters `user_confirmed_action_email_content`, `user_erasure_complete_email_subject`, and `user_erasure_complete_email_headers` have been deprecated.

They have been replaced with `user_erasure_fulfillment_email_content`, `user_erasure_fulfillment_email_subject`, and `user_erasure_fulfillment_email_headers`.

Props desrosj, garrett-eclipse, birgire, DrewAPicture, lifeforceinst, ocean90, pbiron, pento, coffee2code, TZ-Media, SergeyBiryukov, johnbillion, audrasjb, davidbaumwald, hellofromTonya, helen, xkon, antpb, peterwilsoncc, lukecarbis.
Fixes #44314.



git-svn-id: https://develop.svn.wordpress.org/trunk@51129 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-09 01:34:09 +00:00
Jonathan Desrosiers
a2969fb07f Tests: Introduce some E2E tests for the Quick Draft dashboard widget.
Props isabel_brison, johnbillion.
Fixes #523905.

git-svn-id: https://develop.svn.wordpress.org/trunk@51128 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-09 00:19:25 +00:00
Jake Spurlock
d56d4afd02 Permalinks: Revert the changes stemming from pagination limits.
In [51118], an attempt was made to add pagination limits. The added tests need to be updated to ensure that they pass with the new changes.

Reverts [51118].

See #50233.


git-svn-id: https://develop.svn.wordpress.org/trunk@51125 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 23:31:46 +00:00
Jake Spurlock
1eb777209d Revisions: Check and return errors for insertions to revisions.
Fixes #30009.

Props rmccue, adamsilverstein, coreymckrill, whyisjake.


git-svn-id: https://develop.svn.wordpress.org/trunk@51124 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 23:23:12 +00:00
Jake Spurlock
38232f655d Media: Add new functions to return the previous/next attachment links.
New functions:

* get_adjacent_image_link()
* get_next_image_link()
* get_previous_image_link()

Fixes #45708.

Props flixos90, DrewAPicture, mor10, antpb, hellofromTonya, whyisjake.




git-svn-id: https://develop.svn.wordpress.org/trunk@51122 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 23:12:22 +00:00
Anthony Burchell
c2313c6934 Feeds: Avoid notices in get_post_comments_feed_link().
When an feed request is made to a non-existent page, surpress the notice.

Props dd32, SergeyBiryukov, mukesh27, hellofromTonya.
Fixes #52814.



git-svn-id: https://develop.svn.wordpress.org/trunk@51121 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 22:59:19 +00:00
Jake Spurlock
346e47b176 Permalinks: Limit pagination for posts with comments.
Additionally, redirect pages back to the source page if comments don't exist.

Props devrekli, carike, sumanm, mukesh27, chaion07, audrasjb, whyisjake, SergeyBiryukov.

Fixes #50233.


git-svn-id: https://develop.svn.wordpress.org/trunk@51118 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 22:49:27 +00:00
Jonathan Desrosiers
f64478d67c Emoji: Update the Twemoji library to version 13.1.0.
This version introduces support for the latest Emoji added in version Emoji 13.1, which includes “face in clouds”, “face exhaling”, and of course, “face with spiral eyes”.

A new corresponding folder has been pushed to WordPress.org in [dotorg:17419].

Rages deep within, ❤️‍🔥.

Props kraftbj., desrosj.
Fixes #52852.

git-svn-id: https://develop.svn.wordpress.org/trunk@51113 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 22:13:27 +00:00
Riad Benguella
0d4bdbf835 Block Editor: Include the page list block server-side code.
On a previous package update, this block's server-side code has been missed.
This was causing the block to not render properly.

Props Chouby, desrosj, mcsf.
Fixes #53309.


git-svn-id: https://develop.svn.wordpress.org/trunk@51105 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 18:11:31 +00:00
Riad Benguella
9ae2587b76 Block Editor: Package updates for WordPress 5.8 beta 1 (batch2).
This includes the following fixes:

 - Fix inspector opening when clicking outside the widget areas
 - Assume light theme when a transparent background is used
 - Make Post blocks non editable inside Query block
 - Rename QueryLoop to PostTemplate block

Props ntsekouras.
See #52991.


git-svn-id: https://develop.svn.wordpress.org/trunk@51101 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 17:31:14 +00:00
Riad Benguella
611d953e15 Block Editor: Add the Site Logo block's server implementation.
Props aristath, timothyblynjacobs, ocean90.
Fixes #53247.


git-svn-id: https://develop.svn.wordpress.org/trunk@51091 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 08:26:23 +00:00
Riad Benguella
377c88d462 Block Editor: Package updates for 5.8 beta 1.
This includes the following fixes:


Widgets Editor:
  - Load widgets.php https://github.com/WordPress/gutenberg/pull/32299
 - Fix Legacy Widget Preview https://github.com/WordPress/gutenberg/pull/32300
 - Fix error when saving empty Legacy Widget block https://github.com/WordPress/gutenberg/pull/32359

Widget blocks in the customizer: 
 - Fix deselection blocks when the inspector is open https://github.com/WordPress/gutenberg/pull/32361
 - Display wide widgets as popovers https://github.com/WordPress/gutenberg/pull/31736

Global Styles:
 - Align classNames generation between client and server https://github.com/WordPress/gutenberg/pull/32352
 - Group typography block supports https://github.com/WordPress/gutenberg/pull/32252 https://github.com/WordPress/gutenberg/pull/32444 https://github.com/WordPress/gutenberg/pull/32459
 - Make theme.json syntax errors more visible to the users https://github.com/WordPress/gutenberg/pull/32404


Template Editor:
  - Update the appearance of the template details https://github.com/WordPress/gutenberg/pull/32042
  - Fix layout definition https://github.com/WordPress/gutenberg/pull/32425
  - Fix grouping post content block https://github.com/WordPress/gutenberg/pull/32453

Miscellaneous:
 - Prevent saving when the post is locked https://github.com/WordPress/gutenberg/pull/32341
 - Fix allowed block patterns selector https://github.com/WordPress/gutenberg/pull/32376
 - Fix wrong results in the Post Author picker https://github.com/WordPress/gutenberg/pull/32344
 - Fix notices position in top toolbar mode https://github.com/WordPress/gutenberg/pull/32238
 - Allow non-latin characters in post slugs https://github.com/WordPress/gutenberg/pull/32232
 - Fix Random collapse of the color settings panel https://github.com/WordPress/gutenberg/pull/32388
 - Fix theme logo theme mode not being removed on theme removal https://github.com/WordPress/gutenberg/pull/32370
 - Fix block alignment styles in the editor https://github.com/WordPress/gutenberg/pull/32454
 - Fix some block toolbar overlaps https://github.com/WordPress/gutenberg/pull/32424
 - Fix content loss when switching list types https://github.com/WordPress/gutenberg/pull/32432


Performance:
 - Improve the performance of buttons block https://github.com/WordPress/gutenberg/pull/32356
 - Improve the performance of the container blocks https://github.com/WordPress/gutenberg/pull/32380

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.


git-svn-id: https://develop.svn.wordpress.org/trunk@51089 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 08:07:15 +00:00
Robert Anderson
8add05ff15 Make new WordPress installations use blocks in widget areas instead of widgets
Modifies `wp_install_defaults()` so that when you install a new WordPress site you
have block in your widget areas, not widgets.

Fixes #53324.
Props isabel_brison, hellofromtonya, andraganescu.


git-svn-id: https://develop.svn.wordpress.org/trunk@51088 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 01:54:27 +00:00
Sergey Biryukov
37a4faa7ed Tests: Use assertSame() in some newly introduced tests.
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 [50380], [50959], [50960], [50973], [50993], [51003], [51051], [51054].

See #52482.

git-svn-id: https://develop.svn.wordpress.org/trunk@51079 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-07 11:16:29 +00:00
Robert Anderson
176da85be9 Fix failing block editor test
Removes the Meta and Nav Menu widgets from the set of widgets expected by the
test for get_default_block_editor_settings().

Follows [51067].
See #53301.


git-svn-id: https://develop.svn.wordpress.org/trunk@51069 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-04 05:25:31 +00:00
Robert Anderson
08d48b9e21 REST API: Fix delete widget endpoint
Makes the `DELETE /wp/v2/widgets/:id?force=1` endpoint actually delete the
widget from the `"widget-$id_base"` option and not just remove it from
`'sidebars_widgets'`.

Fixes #53313.
Props TimothyBlynJacobs.


git-svn-id: https://develop.svn.wordpress.org/trunk@51059 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-02 01:21:17 +00:00
Sergey Biryukov
f5ca52c617 Tests: Remove the ::append_to_selector() method from Tests_Theme_wpThemeJson.
The method exists in the `WP_Theme_JSON` class and appears to be erroneously duplicated in the test class.

Add a unit test that was meant to be included instead, as per https://github.com/WordPress/gutenberg/pull/32190.

Follow-up to [51051].

See #52991.

git-svn-id: https://develop.svn.wordpress.org/trunk@51054 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-01 11:30:05 +00:00
Riad Benguella
f166ac5b8f Block Editor: Update the Gutenberg branch used to launch Gutenberg e2e tests.
In core, you can run `tests/gutenberg/run.js` script to run the Gutenberg e2e tests
against Core with the plugin being disabled. This test ensures that the integration
of the block editor with Core is working properly.

This commit updates the Gutenberg base branch to be used for the tests to be wp/trunk
which corresponds to the latest packages that are included in Core.

See #52991.


git-svn-id: https://develop.svn.wordpress.org/trunk@51052 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-01 09:21:36 +00:00
Riad Benguella
80957a6179 Block Editor: Update packages and backport the latest Gutenberg fixes.
This includes the following fixes:

- Generate babel polyfill dynamically https://github.com/WordPress/gutenberg/pull/31279
- Improve the List View component https://github.com/WordPress/gutenberg/pull/31290 https://github.com/WordPress/gutenberg/pull/32063
- Template mode:
    - Fix embed dimensions https://github.com/WordPress/gutenberg/pull/32057
    - Update the welcome guide https://github.com/WordPress/gutenberg/pull/32055 https://github.com/WordPress/gutenberg/pull/32026
    - Don’t display the notice at the same time as the welcome guide https://github.com/WordPress/gutenberg/pull/32076
    - Remove MetaBoxes https://github.com/WordPress/gutenberg/pull/32315
    - Update the title area https://github.com/WordPress/gutenberg/pull/32037 
- Widgets Screen:
    - Fix unsaved changes https://github.com/WordPress/gutenberg/pull/31757
    - Fix toolbar alignment https://github.com/WordPress/gutenberg/pull/31991
    - Fix block toolbar position after scroll https://github.com/WordPress/gutenberg/pull/32212
    - Fix the visible widget area header https://github.com/WordPress/gutenberg/pull/32262
    - Fix legacy widgets preview https://github.com/WordPress/gutenberg/pull/32260
    - 
- Block Widgets in the customizer: 
    - Fix customizer title overlapping block toolbar https://github.com/WordPress/gutenberg/pull/32140
    - Fix styling issues https://github.com/WordPress/gutenberg/pull/32072
    - Fix escape key events https://github.com/WordPress/gutenberg/pull/32175
    - Add preferences menu group label https://github.com/WordPress/gutenberg/pull/32259
    - Fix creating and replacing legacy widgets https://github.com/WordPress/gutenberg/pull/32005
    - Fix the welcome guide’s image https://github.com/WordPress/gutenberg/pull/32264 https://github.com/WordPress/gutenberg/pull/32302 
- Fix Cover to Image transform duotone error https://github.com/WordPress/gutenberg/pull/32006
- Remove filter_var usage from blocks https://github.com/WordPress/gutenberg/pull/32046 
- Fix image width for aligned Post Featured Image block https://github.com/WordPress/gutenberg/pull/32070
- Prevent excessive Image block re-rendering https://github.com/WordPress/gutenberg/pull/32102
- Remove gutenberg domain from core blocks https://github.com/WordPress/gutenberg/pull/32152
- Use the block editor context class for the the different settings filters https://github.com/WordPress/gutenberg/pull/32159
- Fix Latest Posts block grid view https://github.com/WordPress/gutenberg/pull/32160
- Fix preset classes generation per block https://github.com/WordPress/gutenberg/pull/32190
- Fix logic to enable custom colors and gradients https://github.com/WordPress/gutenberg/pull/32200
- Update the Site Logo logic to use a dedicated site option https://github.com/WordPress/gutenberg/pull/32229
- Limit the Latest Posts block’s featured image width https://github.com/WordPress/gutenberg/pull/32245
- Remove opacity animation in the canvas. https://github.com/WordPress/gutenberg/pull/32266
- Make the focus style valid CSS https://github.com/WordPress/gutenberg/pull/32305
- Fix theme.json styles for the core/list block https://github.com/WordPress/gutenberg/pull/32343
- Fix PHP notice when calling render_block https://github.com/WordPress/gutenberg/pull/32135

Props nosolosw, noisysocks.
See #52991.


git-svn-id: https://develop.svn.wordpress.org/trunk@51051 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-01 08:07:07 +00:00
Timothy Jacobs
8edfb80800 REST API: Remove duplicates in the widget types endpoint.
Props noisysocks, spacedmonkey, imath, isabel_brison.
Fixes #53305.


git-svn-id: https://develop.svn.wordpress.org/trunk@51049 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-31 20:56:22 +00:00
Peter Wilson
41513c2d0f REST API: Re-introduce WP_Test_REST_Widgets_Controller tests.
Returns the test suite with the addition of defining a URL in the RSS widget within `WP_Test_REST_Widgets_Controller::test_get_items()` to work around an infinite loop in `WP_Widget_RSS` on PHP 8 if the URL is unset or empty.

Reverts [51020].

Props peterwilsoncc, TimothyBlynJacobs.
See #41683.



git-svn-id: https://develop.svn.wordpress.org/trunk@51029 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-26 06:14:08 +00:00
Peter Wilson
55db8c73a3 Posts, Post Types: Improve post_exists() query.
Add `$status` parameter to `post_exists()` to allow developers to specify a post type, date and status to ensure they hit the `wp_posts` table's `type_status_date` index when determining if a post exists.

Props apokalyptik, boonebgorges, brettshumaker, DrewAPicture, MikeHansenMe, peterwilsoncc, whyisjake.
Fixes #34012.



git-svn-id: https://develop.svn.wordpress.org/trunk@51027 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-26 02:16:01 +00:00