mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 23:27:39 +02:00
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, timothyblynjacobs. Merges [51377] to the 5.8 branch. Fixes #53612. Built from https://develop.svn.wordpress.org/branches/5.8@51385 git-svn-id: http://core.svn.wordpress.org/branches/5.8@50996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bee64c88cb
commit
54a19b3fb9
@ -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();
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.8-RC2-51384';
|
||||
$wp_version = '5.8-RC2-51385';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user