/**
* Renders the 'core/legacy-widget' block.
*
* @param array $attributes The block attributes.
*
* @return string Rendered block.
*/
function render_block_core_legacy_widget( $attributes ) { global $wp_widget_factory;
if ( isset( $attributes['id'
] ) ) { $sidebar_id =
wp_find_widgets_sidebar( $attributes['id'
] );
return wp_render_widget( $attributes['id'
],
$sidebar_id );
} if ( !
isset( $attributes['idBase'
] ) ) { return '';
} $id_base =
$attributes['idBase'
];
$widget_key =
$wp_widget_factory->
get_widget_key( $id_base );
$widget_object =
$wp_widget_factory->
get_widget_object( $id_base );