Opened 9 years ago
Last modified 6 years ago
#33915 new enhancement
Add a filter in dynamic_sidebar() function to modify sidebar index
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.3 |
Component: | Widgets | Keywords: | has-patch needs-unit-tests |
Focuses: | Cc: |
Description
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 (3)
Change History (14)
#2
@
9 years ago
- Keywords needs-patch added; has-patch removed
Thanks for your report.
Would you mind updating your patch according to this guide? You shouldn't upload the whole changed file, but only a diff of what's changed.
Besides that, dynamic_sidebar()
already has lots of hooks. Is there no way to use those for what you wanna accomplish? Perhaps a proof-of-concept example might help.
Changing sidebars depending on the page/post/etc loaded through a plugin. Nothing too complex, just no way to do it.
Plugins like WooSidebars have been doing this successfully for years. How are they accomplishing this?
This ticket was mentioned in Slack in #core by chriscct7. View the logs.
9 years ago
#9
@
9 years ago
- Keywords needs-unit-tests added
- Milestone changed from 4.5 to Future Release
Even though this is a fairly minor change, there hasn't been any feedback on why it is necessary and how usage would look like. Some unit tests and perhaps even a sample proof-of-concept plugin would be neat.
See also #34942.
Added dynamic_sidebar_index filter in this sidebar