Is it possible to return a widget instance into a variable or array? I'm thinking something along the lines of $widget['title']$widget['title']
, $widget['content']$widget['content']
etc.
I have tried inspecting the global $wp_registered_widgetsglobal $wp_registered_widgets
variable but this only seems to contain information relevant to rendering the widget, not the widget content itself. I am also able to retrieve the rendered widget by using
ob_start();
dynamic_sidebar('widgetarea');
$sidebar = ob_get_contents();
ob_end_clean();
Which I suppose I could then parse into a series of dom nodes with jQuery parseHTML method, however this seems like a very messy way to go about it and I wonder if anyone could suggest a more elegant way?