[wp-trac] [WordPress Trac] #41239: Add filter in dynamic_sidebar() to allow changing the index before rendering

WordPress Trac noreply at wordpress.org
Wed Jul 5 16:39:40 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             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by jantank):

 @westonruter I read about #40432 and had the same feeling with my Plugin,
 that the UX experience is not great currently. With that change it might
 get better. And also it might fix my problem.

 Thing is, that thread is only talking about what changes could/should be
 made. Is there a plan to fix it in the next release? I guess, that there
 is more work involved than just a one line fix!?

 I just tested your proposed solution in the last comment. Had to change it
 a bit, but now it works. Thanks!

 I guess, that I was so fixed on changing the index, that changing the
 whole sidebar_widgets array didn't came to my mind. Now I just need to
 make my code efficient, as "wp_get_sidebars_widgets" is called more often
 than "dynamic_sidebar". But from the look of it, that might get tricky as
 other Plugins/Themes could also try to alter that list. Changing just the
 index seems to be less overhead.

 Still I think, that it might be a good idea to add that filter or are
 there other reasons not to do so?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41239#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list