WordPress/wp-includes/rest-api/endpoints
Bernhard Reiter ca3cfae579 Blocks: Allow arrays for deprecated asset types in block registration.
In `register_block_type`, continue to allow passing arrays as the `editor_script`, `script`, `view_script`, `editor_style`, and `style` arguments. Note that those fields were soft-deprecated in favor of their `_handles` counterparts in [54155], which would allow specifying multiple items. At the same time, the deprecated fields were limited to `string` or `null`.

However, this broke existing code that passed an array as one of those arguments. For backwards compatibility, this change thus restores the previous behavior. It is implemented in `WP_Block_Type` as a pair of `__get()` and `__set()` methods that wrap around the corresponding `_handles` members, which are arrays of strings.

It also affects the REST API endpoint for block types. The latter’s schema has never allowed for anything other than `string` or `null` for any of those fields. For this reason, it now returns the first element of the array stored in the corresponding `_handles` member in `WP_Block_Type`.

Follow-up [54155].
Props nendeb55, costdev, gziolo, spacedmonkey, mukesh27, sergeybiryukov, audrasjb.
Fixes #56707.
Built from https://develop.svn.wordpress.org/trunk@54670


git-svn-id: http://core.svn.wordpress.org/trunk@54222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-24 14:16:12 +00:00
..
class-wp-rest-application-passwords-controller.php
class-wp-rest-attachments-controller.php Media: Refactor search by filename within the admin. 2022-10-17 11:19:11 +00:00
class-wp-rest-autosaves-controller.php
class-wp-rest-block-directory-controller.php
class-wp-rest-block-pattern-categories-controller.php
class-wp-rest-block-patterns-controller.php Editor: Remove leading whitespace from some translated strings. 2022-09-29 17:54:09 +00:00
class-wp-rest-block-renderer-controller.php
class-wp-rest-block-types-controller.php Blocks: Allow arrays for deprecated asset types in block registration. 2022-10-24 14:16:12 +00:00
class-wp-rest-blocks-controller.php
class-wp-rest-comments-controller.php
class-wp-rest-controller.php
class-wp-rest-edit-site-export-controller.php
class-wp-rest-global-styles-controller.php
class-wp-rest-menu-items-controller.php
class-wp-rest-menu-locations-controller.php
class-wp-rest-menus-controller.php
class-wp-rest-pattern-directory-controller.php
class-wp-rest-plugins-controller.php
class-wp-rest-post-statuses-controller.php
class-wp-rest-post-types-controller.php
class-wp-rest-posts-controller.php Posts, Post Types: Ensure all entries in the list returned by wp_parse_list() are scalar. 2022-10-11 13:25:11 +00:00
class-wp-rest-revisions-controller.php
class-wp-rest-search-controller.php
class-wp-rest-settings-controller.php
class-wp-rest-sidebars-controller.php
class-wp-rest-site-health-controller.php
class-wp-rest-taxonomies-controller.php Taxonomy: Correct an invalid @param tag. 2022-10-11 09:56:11 +00:00
class-wp-rest-templates-controller.php Editor: Remove leading whitespace from some translated strings. 2022-09-29 17:54:09 +00:00
class-wp-rest-terms-controller.php REST API: Lockdown post parameter of the terms endpoint. 2022-10-17 11:38:11 +00:00
class-wp-rest-themes-controller.php
class-wp-rest-url-details-controller.php
class-wp-rest-users-controller.php Code Modernization: Fix null to non-nullable deprecation in WP_REST_Users_Controller::update_item(). 2022-09-26 21:46:09 +00:00
class-wp-rest-widget-types-controller.php
class-wp-rest-widgets-controller.php