#20127 closed enhancement (duplicate)
Add filter in dynamic_sidebar() to modify sidebar index
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.3.1 |
Component: | Widgets | Keywords: | has-patch |
Focuses: | Cc: |
Description
Use case: changing sidebars depending on the page/post/etc loaded through a plugin. Nothing too complex, just no way to do it. There is a filter dynamic_sidebar_params but that isn't called until later on in the function after the widgets have been collected for that sidebar.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Currently I believe this is possible. Look at the
widget_display_callback
filter. You could conditionally add__return_false
to the filter to remove all widgets then add your replacements using the dynamic_sidebar action hook.Please reopen if you feel the discussion should continue.