diff --git a/lib/widgets.php b/lib/widgets.php index b756cce99d522..c2f9a08d90d69 100644 --- a/lib/widgets.php +++ b/lib/widgets.php @@ -95,7 +95,12 @@ function gutenberg_legacy_widget_settings( $settings ) { if ( ! in_array( $class, $core_widgets ) ) { $available_legacy_widgets[ $class ] = array( 'name' => html_entity_decode( $widget_obj->name ), - 'description' => html_entity_decode( $widget_obj->widget_options['description'] ), + // wp_widget_description is not being used because its input parameter is a Widget Id. + // Widgets id's reference to a specific widget instance. + // Here we are iterating on all the available widget classes even if no widget instance exists for them. + 'description' => isset( $widget_obj->widget_options['description'] ) ? + html_entity_decode( $widget_obj->widget_options['description'] ) : + null, 'isCallbackWidget' => false, ); }