diff --git a/lib/class-wp-widget-block.php b/lib/class-wp-widget-block.php index b5fbe90c2162e..16f5e093260eb 100644 --- a/lib/class-wp-widget-block.php +++ b/lib/class-wp-widget-block.php @@ -54,8 +54,6 @@ public function __construct() { */ public function widget( $args, $instance ) { echo sprintf( $args['before_widget'], $this->get_dynamic_classname( $instance ) ); - echo do_blocks( $instance['content'] ); - // Handle embeds for block widgets. // // When this feature is added to core it may need to be implemented @@ -63,7 +61,10 @@ public function widget( $args, $instance ) { // filter for its content, which WP_Embed uses in its constructor. // See https://core.trac.wordpress.org/ticket/51566. global $wp_embed; - echo $wp_embed->autoembed( $content ); + $content = $wp_embed->run_shortcode( $instance['content'] ); + $content = $wp_embed->autoembed( $content ); + + echo do_blocks( $content ); echo $args['after_widget']; }