44021 Commits

Author SHA1 Message Date
Jonathan Desrosiers
834c0996cf Widgets: Add support for the Widgets Editor on after_setup_theme instead of widgets_init.
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
2021-06-23 01:07:27 +00:00
Jonathan Desrosiers
1af21df75b Editor: Correct variable names in get_block_editor_settings().
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
2021-06-23 00:25:14 +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
Andrew Ozz
a59cea3c92 Media: Prevent uploading and show an error message when the server doesn't support editing of WebP files and image sub-sizes cannot be created.
Props adamsilverstein, desrosj, azaozz
Fixes #53475

git-svn-id: https://develop.svn.wordpress.org/trunk@51211 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 23:11:02 +00:00
Jonathan Desrosiers
9115546cc7 Docs: Shorten the copyright notice for the WP_REST_Sidebars_Controller class.
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
2021-06-22 23:04:48 +00:00
Kelly Choyce-Dwan
d6db890e1c Twenty Nineteen: Update margins on full- and wide-aligned blocks in the editor.
Previously, full width blocks would cause a horizontal scrollbar, and nesting full width blocks would cause the content to be pulled off the screen. Now wide and full width blocks can be nested without any visual issues.

Props aleperez92, Boniu91, onemaggie, hellofromTonya.
Fixes #53428.



git-svn-id: https://develop.svn.wordpress.org/trunk@51209 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 22:14:08 +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
Ian Dunn
7311d4eb59 Block Editor: Send locale, version with remote pattern requests.
This information is needed by the w.org API for translation and caching.

Props dd32, ryelle, tellyworth
See #53435


git-svn-id: https://develop.svn.wordpress.org/trunk@51206 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 21:20:44 +00:00
Kelly Choyce-Dwan
a7f35375fa Bundled Themes: Improve display of blocks in widget areas.
Fixes minor styling issues, mostly font size and spacing, in blocks used in widget areas. Changes made to Twenty Ten, Twenty Thirteen, Twenty Fourteen, Twenty Sixteen, Twenty Seventeen, and Twenty Twenty-One.

Props noisysocks, sumaiyasiddika, danieldudzic, scruffian, jffng.
Fixes #53422.



git-svn-id: https://develop.svn.wordpress.org/trunk@51205 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 20:13:46 +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
f3b1cc24e4 Editor: Allow custom-units to be an array.
The changes in [50959] introduced an issue where `custom_units` was always being coerced into a boolean value. This should support `array` values.

Props kraftner, youknowriad, nosolosw, jorgefilipecosta.
Fixes #53472.

git-svn-id: https://develop.svn.wordpress.org/trunk@51203 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 17:15:27 +00:00
Jonathan Desrosiers
7368e86994 Widgets: Stop loading wp-editor and the Block Directory assets on the widgets screen.
When using the text widget, a `wp.editor.initialize is not a function` notice is encountered. This happens when `wp-editor` is loaded as a dependency, which assigns `wp.oldEditor = wp.editor` and then redefines `wp.editor`.

`wp-editor` is only used for the Classic block, which is not supported in the new widgets editor. [51198-51199] updated `@wordpress/block-library` to remove `wp-editor` as a dependency, but it’s still listed as a dependency of the `wp-block-directory` script handle.

Since the Block directory is not supported within the widgets editor, the related assets can safely be blocked from enqueueing.

Props noisysocks, gziolo, Mamaduka, mkaz.
Fixes #53437. See #53397.

git-svn-id: https://develop.svn.wordpress.org/trunk@51202 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 16:54:50 +00:00
Kelly Choyce-Dwan
4351b2ca31 Twenty Twenty-One: Add margins around content in Post Template block.
Props desrosj, joen.
See #53389, #53398.



git-svn-id: https://develop.svn.wordpress.org/trunk@51201 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 16:54:21 +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
b668efd6ff Block Editor: Package updates for Beta 3.
The commit updates the WordPress packages for beta 3.

Props nosolosw, noisysocks, youknowriad.
See #53397.

git-svn-id: https://develop.svn.wordpress.org/trunk@51199 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 09:58:32 +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
Peter Wilson
098ab594fe Themes: Improve Gutenberg check before activating an FSE theme.
Account for sites enabling Gutenberg as an mu-plugin when determining whether full-site-editing themes can be enabled. This replaces the check the plugin is active with a check whether the function `gutenberg_is_fse_theme()` is defined.

Follow up to [51193].

Props noisysocks, peterwilsoncc, SergeyBiryukov.
See #53410.



git-svn-id: https://develop.svn.wordpress.org/trunk@51197 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 05:55:52 +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
Anthony Burchell
302d50e62c Media: Improve upload page media item layout on smaller screens.
This allows smaller screens to wrap error messages and other uploader media item elements in a more readable way.

Props joedolson sabernhardt, Presskopp.
See #51754.



git-svn-id: https://develop.svn.wordpress.org/trunk@51195 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 04:25:16 +00:00
Jonathan Desrosiers
a6a9b3118f Themes: Remove unexpected border around the Theme Details button.
After [51083], the Theme Details button is now displaying a border unintentionally. This removes it.

Props ryelle.
Fixes #53473.

git-svn-id: https://develop.svn.wordpress.org/trunk@51194 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 04:02:09 +00:00
Jonathan Desrosiers
4226bc8689 Themes: Prevent a Full Site Editing theme from being activated when Gutenberg is not active.
When a theme that uses the Full Site Editing feature is activated and the Gutenberg plugin is not present, the site will currently show a text notice on the front end. The user is not made aware of this unless they visit the front end of their site.

This adds a check that will prevent a theme from being activated when the `full-site-editing` tag is present in the theme’s `style.css` header and the Gutenberg plugin is not active to prevent this scenario.

These checks can be removed once Full Site Editing is completely merged into Core.

Props desrosj, marybaum, chanthaboune.
See #53410.

git-svn-id: https://develop.svn.wordpress.org/trunk@51193 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-22 02:58:07 +00:00
Jonathan Desrosiers
a3da548cc4 Twenty Thirteen: Improve the display of the Query Loop block.
This fixes an issue where Query Loop blocks were displayed with list bullets and extra `padding-left`.

Props AlePerez92, scruffian, ryelle.
Fixes #53438.

git-svn-id: https://develop.svn.wordpress.org/trunk@51192 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-21 23:38:31 +00:00
Joe Dolson
422d301ac0 Media: Update total attachment count when media added or removed.
Add handlers to increment the total attachments count for the media collection when an item is added or removed.

props adamsilverstein.
Fixes #53171.

git-svn-id: https://develop.svn.wordpress.org/trunk@51191 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-21 20:44:41 +00:00
Sergey Biryukov
d0e8b81cd8 Users: Escape get_author_posts_url() link in wp_list_authors().
This is consistent with `get_the_author_posts_link()`.

Props chintan1896.
Fixes #50698.

git-svn-id: https://develop.svn.wordpress.org/trunk@51190 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-21 06:05:30 +00:00
Sergey Biryukov
63f4733ead Administration: Consistently escape network_admin_url() links.
Follow-up to [51177].

Props chintan1896, mukesh27.
Fixes #53459.

git-svn-id: https://develop.svn.wordpress.org/trunk@51189 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-21 04:29:18 +00:00
Sergey Biryukov
f14b45a57e Docs: Correct @since version in the wp-includes/version.php file header.
There was no public release of WordPress 1.1.

Follow-up to [803], [43662].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@51188 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-21 04:28:32 +00:00
Joe Dolson
39ecd7846d Media: Adapt response shape depending on type of query.
Restore inheriting the backbone fetch in the media library and adapt the AJAX response according to the action performed in the media query.

In [51145], the response shape was restored to the original shape, and a custom fetch was added to handle assigning the totalAttachments information in the collection. The custom fetch triggered a new set of bugs relating to zero-sized collections and loading individual images. 

props adamsilverstein, ryelle, peterwilsoncc, Presskopp, desrosj.
Fixes #53421, #53419.

git-svn-id: https://develop.svn.wordpress.org/trunk@51187 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-20 23:25:55 +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
510b9d60ae Docs: Correct DocBlock formatting for Core_Upgrader::upgrade().
Document the `$auto_update_settings` parameter of the `after_core_auto_updates_settings` action.

Follow-up to [49254].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@51185 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-19 21:36:01 +00:00
Sergey Biryukov
ceb12aa0c7 Docs: Add a reference to WP_Site_Query::__construct() for information on accepted arguments in get_sites().
Synchronize the documentation between two places, use `WP_Site_Query::__construct()` as the canonical source.

Follow-up to [37616].

Props birgire, felipeelia, audrasjb.
Fixes #42156.

git-svn-id: https://develop.svn.wordpress.org/trunk@51184 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-19 20:55:52 +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
c264ba80df Upgrade/Install: Deactivate the Gutenberg plugin if its version is 10.7 or lower.
This avoids a fatal error due to `WP_Block_Template` class redeclaration when updating to WordPress 5.8 with an older version of Gutenberg activated.

Follow-up to [35582] for the REST API plugin.

Props hellofromTonya, oglekler, azaozz, desrosj, pbiron, jorbin, youknowriad, TimothyBlynJacobs, Clorith, markparnell.
See #53432.

git-svn-id: https://develop.svn.wordpress.org/trunk@51180 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-18 12:12:57 +00:00
Jonathan Desrosiers
5267e4a40c Build/Test Tools: Use Git when fetching the WordPress Importer for use in tests.
This switches to using Git in the local Docker environment install script to check out a copy of the WordPress Importer plugin for use in unit tests.

Previously, SVN was used and the commands were not correctly run within the Docker container. The container does not actually have SVN installed, and the script was only working when the machine running the command had SVN present.

Props czapla, alexstine, jnylen0, francina, desrosj.
Fixes #52909.

git-svn-id: https://develop.svn.wordpress.org/trunk@51179 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-17 17:57:54 +00:00
Sergey Biryukov
dc999004b8 Coding Standards: Bring some consistency to HTML formatting in wp-admin/comment.php.
See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@51178 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-17 14:48:42 +00:00
Sergey Biryukov
d3c8a93cad Administration: Consistently escape admin_url() links.
Props chintan1896, mukesh27.
Fixes #53426.

git-svn-id: https://develop.svn.wordpress.org/trunk@51177 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-17 14:35:59 +00:00
Sergey Biryukov
c62f77e2e8 Editor: Include Cover block in the list of block types registered using metadata files.
This ensures that block stylesheets are rendered properly when `should_load_separate_core_block_assets` filter is turned on.

Follow-up to [50824], [50836].

Props walbo.
Fixes #53440.

git-svn-id: https://develop.svn.wordpress.org/trunk@51176 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-17 11:56:08 +00:00
Sergey Biryukov
ddd0952ec1 Coding Standards: Fix WPCS issue in [51174].
See #53407.

git-svn-id: https://develop.svn.wordpress.org/trunk@51175 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-17 11:32:57 +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
Jonathan Desrosiers
81182b52ef Build/Test Tools: Ignore sourceMaps for non WordPress Core files.
If a custom plugin or theme exists in the `build/wp-content` directory with a sourcemap, the build` script is currently returning a warning and failing.

This improves the `verify:source-maps` task in Grunt to ignore directories and files that do not belong to WordPress Core.

Props ryelle, afragen, johnbillion.
Fixes #52689.

git-svn-id: https://develop.svn.wordpress.org/trunk@51173 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-16 22:56:32 +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
Sergey Biryukov
77adbdf376 External Libraries: Upgrade PHPMailer to version 6.5.0.
Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.0

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.4.1...v6.5.0

Props ayeshrajans, Synchro.
Fixes #53430.

git-svn-id: https://develop.svn.wordpress.org/trunk@51169 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-16 17:01:39 +00:00
Sergey Biryukov
fdc2244647 Docs: Update syntax for some multi-line comments per the documentation standards.
Follow-up to [51003], [51149].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@51168 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-16 09:41:44 +00:00
Sergey Biryukov
afee26086f Editor: Check if supports metadata key is defined before migrating typography keys.
This avoids an "Undefined index" PHP notice on blocks without a `supports` key in `block.json`.

Follow-up to [51089], [51153], [51159]. 

Props walbo.
Fixes #53416.

git-svn-id: https://develop.svn.wordpress.org/trunk@51167 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 21:36:07 +00:00
Sergey Biryukov
82bd4bf5f7 Docs: Update syntax for multi-line comment in wp_generate_attachment_metadata() per the documentation standards.
Follow-up to [23766], [25968], [35554], [51162].

Props hellofromTonya.
Fixes #52603.

git-svn-id: https://develop.svn.wordpress.org/trunk@51166 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 19:09:31 +00:00
Jonathan Desrosiers
5bf13be488 Post WordPress 5.8 Beta 2 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@51165 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 18:04:44 +00:00
Jonathan Desrosiers
59d2ddab14 WordPress 5.8 Beta 2.
git-svn-id: https://develop.svn.wordpress.org/trunk@51164 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 17:39:34 +00:00
Sergey Biryukov
47c9387402 Quick/Bulk Edit: Ensure that $post_ids variable is initialized ahead of usage.
This brings some consistency between similar fragments of `wp-admin/edit.php` and `wp-admin/upload.php`.

Follow-up to [51111], [51161].

See #39589, #53411.

git-svn-id: https://develop.svn.wordpress.org/trunk@51163 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 17:03:05 +00:00