From f3504cd9458def4062c14ca8258d0d7a2d014910 Mon Sep 17 00:00:00 2001 From: TimothyBlynJacobs Date: Mon, 31 May 2021 20:57:58 +0000 Subject: [PATCH] REST API: Remove duplicates in the widget types endpoint. Props noisysocks, spacedmonkey, imath, isabel_brison. Fixes #53305. Built from https://develop.svn.wordpress.org/trunk@51049 git-svn-id: http://core.svn.wordpress.org/trunk@50658 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../endpoints/class-wp-rest-widget-types-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-widget-types-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php index 4fdd3ac1e2..f09277c173 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php @@ -225,7 +225,7 @@ class WP_REST_Widget_Types_Controller extends WP_REST_Controller { } $widget['classname'] = ltrim( $classname, '_' ); - $widgets[] = $widget; + $widgets[ $widget['id'] ] = $widget; } return $widgets; diff --git a/wp-includes/version.php b/wp-includes/version.php index 6a22a2501a..20301c80da 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-51048'; +$wp_version = '5.8-alpha-51049'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.