Site icon Hip-Hop Website Design and Development

Is there any way to parse blocks inside widget area?

As widgets are outside post content, i couldn’t find the way to parse blocks inserted inside widget area for ex. "sidebar-1"

We use something like below for parsing post contents,

$post = get_post('100');
parse_blocks($post->post_content) 

But for widgets, i couldn’t do it like below,

ob_start();
dynamic_sidebar('sidebar-1');
$widget_content = ob_get_clean();
parse_blocks($widget_content)