Bernhard Reiter
c46c60f71d
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.
Merges [54670] to the 6.1 branch.
Fixes #56707 .
Built from https://develop.svn.wordpress.org/branches/6.1@54671
git-svn-id: http://core.svn.wordpress.org/branches/6.1@54223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-24 14:32:18 +00:00
..
2022-10-19 11:30:32 +00:00
2022-04-12 09:26:16 +00:00
2022-10-19 12:30:12 +00:00
2022-10-18 13:56:02 +00:00
2022-10-18 13:56:02 +00:00
2022-10-17 11:26:11 +00:00
2022-10-04 02:08:11 +00:00
2021-11-16 00:04:01 +00:00
2022-10-19 11:30:32 +00:00
2022-04-06 15:20:06 +00:00
2022-10-09 17:12:31 +00:00
2022-09-26 20:56:10 +00:00
2022-02-16 21:19:04 +00:00
2021-12-06 21:30:03 +00:00
2022-10-24 14:32:18 +00:00
2021-12-20 19:33:00 +00:00
2022-09-12 15:47:14 +00:00
2022-09-26 14:00:10 +00:00
2022-10-11 15:00:12 +00:00
2022-03-22 16:25:03 +00:00
2022-03-22 16:25:03 +00:00
2022-09-26 22:43:10 +00:00
2022-08-13 22:44:09 +00:00
2022-04-21 11:24:17 +00:00
2022-09-20 16:26:10 +00:00
2022-09-23 14:00:09 +00:00
2022-09-20 16:29:12 +00:00
2022-10-11 17:30:12 +00:00
2022-09-26 22:43:10 +00:00
2022-10-16 15:46:15 +00:00
2022-06-23 22:57:12 +00:00
2022-08-30 15:17:08 +00:00
2022-10-10 18:22:11 +00:00
2022-10-10 18:22:11 +00:00
2022-04-01 03:25:01 +00:00
2022-09-27 16:31:10 +00:00
2022-08-19 23:06:09 +00:00
2022-08-04 14:52:11 +00:00
2022-06-17 11:20:13 +00:00
2022-08-31 13:41:08 +00:00
2022-06-17 11:20:13 +00:00
2021-12-06 21:30:03 +00:00
2021-12-24 18:06:06 +00:00
2022-01-30 19:25:03 +00:00
2022-01-30 19:25:03 +00:00
2022-01-30 19:25:03 +00:00
2022-09-15 12:32:08 +00:00
2022-05-01 22:01:10 +00:00
2022-01-30 19:25:03 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-20 15:43:29 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-10-11 18:46:13 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-10-24 14:32:18 +00:00
2022-10-03 14:41:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 21:50:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-10-17 11:49:11 +00:00
2022-10-11 09:02:14 +00:00
2022-09-28 22:19:10 +00:00
2022-09-12 15:47:14 +00:00
2022-09-26 22:43:10 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2021-12-06 21:30:03 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-19 22:53:10 +00:00
2022-09-19 22:53:10 +00:00
2022-10-07 19:17:12 +00:00
2022-09-12 15:47:14 +00:00
2022-09-26 22:10:16 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-10-18 18:16:16 +00:00
2022-09-20 14:26:10 +00:00
2022-09-26 22:10:16 +00:00
2022-09-12 15:47:14 +00:00
2022-10-20 00:04:15 +00:00
2022-09-12 15:47:14 +00:00
2022-09-26 22:10:16 +00:00
2022-09-12 15:47:14 +00:00
2022-10-18 15:08:12 +00:00
2022-10-04 03:59:13 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-10-04 23:01:13 +00:00
2022-09-12 15:47:14 +00:00
2022-09-19 20:49:10 +00:00
2022-09-28 22:19:10 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-10-18 18:16:16 +00:00
2022-09-12 15:47:14 +00:00
2022-09-28 14:59:10 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-10-11 15:00:12 +00:00
2022-10-14 10:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-10-11 20:08:12 +00:00
2022-09-20 01:36:09 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-10-11 01:46:14 +00:00
2022-10-18 16:11:16 +00:00
2022-10-04 15:41:18 +00:00
2022-09-20 14:17:12 +00:00
2022-09-20 14:17:12 +00:00
2022-09-20 14:17:12 +00:00
2022-10-11 15:45:11 +00:00
2022-10-17 11:31:12 +00:00
2022-05-08 00:29:14 +00:00
2022-10-12 11:53:15 +00:00
2022-06-17 11:20:13 +00:00
2022-09-20 01:36:09 +00:00
2022-10-11 18:44:13 +00:00
2022-10-17 11:19:11 +00:00
2022-06-17 11:20:13 +00:00
2022-08-19 22:06:09 +00:00
2022-04-29 19:17:11 +00:00
2021-11-29 09:52:00 +00:00
2022-06-20 21:46:16 +00:00
2022-10-11 15:07:10 +00:00
2022-10-17 11:04:12 +00:00
2022-10-11 09:02:14 +00:00
2022-10-11 09:02:14 +00:00
2022-10-11 09:02:14 +00:00
2022-10-07 12:09:11 +00:00
2022-09-14 13:08:14 +00:00
2022-08-11 14:11:08 +00:00
2022-09-15 13:29:13 +00:00
2022-09-28 22:19:10 +00:00
2022-09-13 18:05:09 +00:00
2022-10-18 18:16:16 +00:00
2022-10-17 11:26:11 +00:00
2022-10-12 13:23:14 +00:00
2022-10-13 17:24:15 +00:00
2022-10-18 18:16:16 +00:00
2022-07-14 13:35:13 +00:00
2022-09-20 02:51:09 +00:00
2022-09-21 19:48:13 +00:00
2022-10-18 18:16:16 +00:00
2022-05-13 12:21:13 +00:00
2022-10-18 18:16:16 +00:00
2022-08-26 01:03:14 +00:00
2022-10-11 14:04:13 +00:00
2022-06-15 13:37:10 +00:00
2022-10-18 18:16:16 +00:00
2022-10-17 11:42:11 +00:00
2022-08-01 11:15:14 +00:00
2022-09-21 20:24:12 +00:00
2022-03-15 15:22:05 +00:00
2022-10-17 11:19:11 +00:00
2022-06-21 13:34:13 +00:00
2022-10-14 15:55:11 +00:00
2022-09-28 14:47:12 +00:00
2022-10-01 03:25:10 +00:00
2022-04-06 15:33:03 +00:00
2022-03-22 16:25:03 +00:00
2022-10-11 20:08:12 +00:00
2022-09-26 22:43:10 +00:00
2022-09-14 12:48:16 +00:00
2022-10-10 12:30:16 +00:00
2021-12-10 20:30:05 +00:00
2022-09-21 01:09:10 +00:00
2022-09-21 11:43:13 +00:00
2022-05-02 13:13:08 +00:00
2022-09-14 18:44:09 +00:00
2022-10-07 20:48:12 +00:00
2022-09-22 11:13:14 +00:00
2022-10-11 13:45:13 +00:00
2022-04-27 13:47:11 +00:00
2022-10-24 14:32:18 +00:00
2022-10-17 12:41:11 +00:00
2022-07-21 22:45:11 +00:00