From 3f7c228c90517f6c1b7a79240be62081ec7740ac Mon Sep 17 00:00:00 2001 From: TimothyBlynJacobs Date: Wed, 7 Jul 2021 19:35:57 +0000 Subject: [PATCH] REST API: Ensure a sidebar's widgets property is a list. When a widget is removed from a sidebar, if it was removed from the middle of the list, the widgets property would become an object with numeric keys. The sidebars controller now forces the widgets property to be a list. Props walbo. Fixes #53612. Built from https://develop.svn.wordpress.org/trunk@51377 git-svn-id: http://core.svn.wordpress.org/trunk@50988 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/endpoints/class-wp-rest-sidebars-controller.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php index 357e35814a..50c84f1dd9 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php @@ -304,7 +304,7 @@ class WP_REST_Sidebars_Controller extends WP_REST_Controller { } ); - $sidebar['widgets'] = $widgets; + $sidebar['widgets'] = array_values( $widgets ); } $schema = $this->get_item_schema(); diff --git a/wp-includes/version.php b/wp-includes/version.php index f4fba08b7f..59a2ac79a8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51375'; +$wp_version = '5.9-alpha-51377'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.