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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
* 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
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
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
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