mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 14:47:02 +00: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. Fixes #53612. git-svn-id: https://develop.svn.wordpress.org/trunk@51377 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user