WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 7 years ago

Last modified 5 years ago

#20127 closed enhancement (duplicate)

Add filter in dynamic_sidebar() to modify sidebar index

Reported by: andrewryno Owned by: andrewryno
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)

dynamic_sidebar-filter.diff (383 bytes) - added by andrewryno 9 years ago.

Download all attachments as: .zip

Change History (4)

#1 @c3mdigital
7 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

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.

#2 @markoheijnen
7 years ago

  • Milestone Awaiting Review deleted

Clearing out the milestones for closed tickets on Awaiting Review

#3 @SergeyBiryukov
5 years ago

  • Resolution changed from wontfix to duplicate

Duplicate of #33915.

Note: See TracTickets for help on using tickets.