[wp-trac] [WordPress Trac] #41239: Add filter in dynamic_sidebar() to allow changing the index before rendering
WordPress Trac
noreply at wordpress.org
Tue Jul 4 17:59:13 UTC 2017
#41239: Add filter in dynamic_sidebar() to allow changing the index before
rendering
-----------------------------+-----------------------------
Reporter: jantank | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Widgets | Version: trunk
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
Hi
I'm currently working on a plugin to build Microsites in a WordPress site.
This allows to apply a different look and feel on a per page basis instead
of having to create a new site in a Multisite setup or using CSS to
overwrite values. For this the Customizer is utilized. In there for every
Microsite the whole options for the normal theme setup is cloned. Menus,
Widgets and all of the Settings.
This works in 4.7 and with themes, that only use the Customizer, pretty
well except for widgets. In the function dynamic_sidebar() in widgets.php
there is no filter, that allows the change of a dynamic registered widget,
as the index can not be changed before render.
A demo of this plugin can be loaded at:
http://plugins.th1nktank.net/microsites.zip
Microsites can be added under Options -> General (you have to currently
hit "Save Changes" after adding a Microsite)
Then go into the customizer and change Menus, Widgets and Options for your
Microsite (after applying this patch)
After doing that, go into the options of a page a select a Microsite for
that page.
This is currently work in progress and a more polished version will
follow.
Some sample pages:
http://plugins.th1nktank.net/
http://plugins.th1nktank.net/about/
http://plugins.th1nktank.net/contact/
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41239>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list