Meanwhile it is developed in the core, I have found this one in the trunk, you can use it 😉
function get_dynamic_sidebar($index = 1)
{
$sidebar_contents = “”;
ob_start();
dynamic_sidebar($index);
$sidebar_contents = ob_get_clean();
return $sidebar_contents;
}
@_dorsvenabili That worked for me =) Do you remember the link to where you found it? It definitely seems like it would be useful to have it as an official function.
Ah found it, for anyone else looking, see: core.trac.wordpress.org/ticket/13169