43994 Commits

Author SHA1 Message Date
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
Sergey Biryukov
7abc29aafc Media: Make sure wp_generate_attachment_metadata() always returns an array.
This matches the documentation for the filter of the same name.

Previously, the function could return `false` for an audio or video attachment that does not exist in the local filesystem.

Props Chouby, SergeyBiryukov.
Fixes #52603.

git-svn-id: https://develop.svn.wordpress.org/trunk@51162 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 16:51:54 +00:00
David Baumwald
3beac35843 Media: Ensure $post_ids is evaluated properly when processing bulk actions.
After [51111], the `$post_ids` variable is now initialized as an empty array when processing a bulk action.  As such, the original check using `isset` on `$post_ids` will always evaluate to `true`.  This change swaps the `isset` checks for `empty` to check array length instead.

Props david.binda, hellofromTonya.
Fixes #53411.

git-svn-id: https://develop.svn.wordpress.org/trunk@51161 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 16:50:49 +00:00
Sergey Biryukov
ba65211c29 I18N: Remove redundant default text domain parameter in some __() calls.
Follow-up to [43919], [44262], [48141], [50259].

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@51160 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 16:15:12 +00:00
Sergey Biryukov
a663d98561 Docs: Add missing documentation for wp_migrate_old_typography_shape().
Follow-up to [51089].

See #52991, #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@51159 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 16:03:04 +00:00
Sergey Biryukov
8bb7054907 Coding Standards: Use consistent formatting for _wp_posts_page_notice() and _wp_block_editor_posts_page_notice().
Remove redundant casting to `int` for post ID, which is always an integer.

Follow-up to [51116].

See #45537, #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@51158 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 15:49:22 +00:00
Sergey Biryukov
68be2fe3c9 I18N: Use consistent pattern for placeholder references in translator comments for some bundled theme strings.
Follow-up to [42827], [44562], [50234].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@51157 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 15:37:13 +00:00
Riad Benguella
dcd5506edc Block Editor: Second batch of fixes for 5.8 beta 2
This includes:

 - Fix regression emptying post content block in template mode.
 - Legacy Widget: Don't display "No preview" when widget has image tags.

See #53397. 


git-svn-id: https://develop.svn.wordpress.org/trunk@51156 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 15:28:52 +00:00
Sergey Biryukov
de961a8bbd Coding Standards: Remove a one-time $message variable in WordPress version requirement notices for bundled themes.
This makes the formatting of these messages more consistent.

Follow-up to [23816], [51154].

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@51155 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 15:23:07 +00:00
Sergey Biryukov
f04ebe2daf Coding Standards: Remove a one-time $message variable in some _doing_it_wrong() calls.
This brings some consistency with most other calls.

Follow-up to [23378], [25605], [34745], [36219], [44108], [46111], [48156].

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@51154 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 15:21:50 +00:00
Sergey Biryukov
8490fcbda3 Editor, I18N: Remove code from a translatable string in wp_migrate_old_typography_shape().
Replace a `trigger_error()` call with `_doing_it_wrong()` for consistency with how similar messages are displayed elsewhere in core.

Follow-up to [51089].

See #52991.

git-svn-id: https://develop.svn.wordpress.org/trunk@51153 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 14:01:57 +00:00
Sergey Biryukov
ddd4ac93a1 Docs: Document the VALID_ORIGINS constant in WP_Theme_JSON.
Follow-up to [51149].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@51152 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 11:23:09 +00:00
Sergey Biryukov
ca539afd54 Docs: Document the usage of $wp_embed global in WP_oEmbed_Controller::get_proxy_item().
Follow-up to [48135].

Fixes #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@51151 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 10:23:57 +00:00
Sergey Biryukov
f31de914f1 Docs: Document the usage of $_wp_current_template_content global in a few block template functions.
Follow-up to [51003], [51149].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@51150 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-15 10:20:54 +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
Jonathan Desrosiers
15c8c705bc Editor: Replace a Gutenberg specific function with the Core equivalent.
This replaces a stray instance of `gutenberg_experimental_set()` with the WordPress Core version of this function, `_wp_array_set()`.

A stray `gutenberg` text domain is also removed from a `__()` call.

Props walbo, chaion07, JeffPaul.
Fixes #53369.

git-svn-id: https://develop.svn.wordpress.org/trunk@51148 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-14 23:43:21 +00:00
Jonathan Desrosiers
e40fec89ab Coding Standards: Apply some alignment fixes.
Follow up to [51145].
See #50105.

git-svn-id: https://develop.svn.wordpress.org/trunk@51147 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-14 23:41:07 +00:00
Jonathan Desrosiers
825a9c7b97 Build/Test Tools: Replace the deprecated @babel/polyfill.
This replaces the dependency of the deprecated `@babel/polyfill` package with the `core-js` package through `@wordpress/babel-preset-default`.

Previously, the file consisted of a generalized group of polyfills, and not all of them were required. This change allows the contents of this file to be built according to the exact needs as dictated by the `@wordpress/babel-preset-default` package, which takes into account the current browser support.

Props gziolo, youknowriad. 
Fixes #52941.

git-svn-id: https://develop.svn.wordpress.org/trunk@51146 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-14 23:16:27 +00:00
Joe Dolson
18ebf26bc3 Media: Restore AJAX response data shape in media library.
Restore the original shape of the AJAX response data in the media library after removing infinite scroll, and pass total number of attachments in the response headers `X-WP-Total` and `X-WP-TotalPages`. 

Improve backwards compatibility for plugins intercepting the ajax response. Headers match the structure and count calculation used in REST API responses.

Fix an issue with hiding the spinner after the load is completed and ensure that the load more view is created when changing tabs in the media library modal.

Follow up to [50829].

props adamsilverstein, spacedmonkey, joedolson.
Fixes #50105.

git-svn-id: https://develop.svn.wordpress.org/trunk@51145 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-14 20:49:05 +00:00
Aaron Jorbin
d9a79d339d Block Editor: Prevent duplicate queries
When passing args to `WP_Query::__construct` method (in this case, but creating a `new WP_Query`, this one internally executes the `WP_Query::get_posts` method and stores the result in the `WP_Query::posts` property. When calling the `WP_Query::get_posts` again, the same SQL query gets executed, and the result is again stored in the `WP_Query::posts` property.

This was introduced in [51003].

Props david.binda, jorbin.
Fixes #53280. See #53176.


git-svn-id: https://develop.svn.wordpress.org/trunk@51144 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-14 20:38:38 +00:00
Jonathan Desrosiers
4787fb116e Site Health: Display a list of file formats supported by the GD library.
This adds the list of file formats supported by the GD library to the Media Handling section in Site Health.

This will help site owners debug any issues they encounter as support for newer, more modern image formats is added (such as WebP in [50810]).

Follow up to [50817].
Props adamsilverstein, jorbin. 
Fixes #53022.

git-svn-id: https://develop.svn.wordpress.org/trunk@51143 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-14 18:58:48 +00:00
Sergey Biryukov
848a678861 Docs: Update documentation for some WP_Customize_Widgets methods per the documentation standards.
* Add missing `@since` tags for the `$id_base` parameter of ::sanitize_widget_instance()` and `::sanitize_widget_js_instance()`.
* Document the usage of `$wp_widget_factory` global in `::sanitize_widget_instance()`.
* Use multi-line comment syntax for a comment in `::enqueue_scripts()`.

Follow-up to [50996], [51141].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@51142 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-14 15:15:26 +00:00
Sergey Biryukov
24f57d1227 Docs: Document the usage of $wp_widget_factory global in WP_Customize_Widgets::sanitize_widget_instance().
Follow-up to [50996].

Props jontyravi, audrasjb.
Fixes #53394.

git-svn-id: https://develop.svn.wordpress.org/trunk@51141 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-14 11:01:42 +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