I am developing a wordpress plugin that creates a widget that would act upon another widget. I have searched but cant seem to find (if it exists) a hook that would give details of all active instances of widgets. any help would be appreciated if you have come across this. thanks
Leave a Reply
You must be logged in to post a comment.
get_option('sidebars_widgets')
gives you an associative array that contains a list of widgets for each sidebar plus a list of all inactive widgets.get_option('widget_widgetname')
will give you an associative array that contains the settings of all instances of your widget.for example to remove a widget from a page
This might vary depending on your theme, so use print_r($sidebars_widgets); to verify the widgets available on your case
You can get all the active widgets of sidebar as follows::
it will give you an associative array containing a list of widgets per sidebar and a list of all inactive widgets.