Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #13169, comment 13


Ignore:
Timestamp:
03/22/2016 08:18:11 PM (9 years ago)
Author:
tikitariki
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13169, comment 13

    initial v1  
    1 I, too, would like to get a return variant of `dynamic_sidebar`. There's no easy way to get a count of WordPress widgets. I figured out a way using a hook for widgets, but I was stopped in my tracks yet again because the widget hooks won't fire off until the widgets are outputted, which is basically when `dynamic_sidebar` is ran. I need that count before calling `dynamic_sidebar`, but since it gets echoed out, I can't arrange the content appropriately. :(
     1I, too, would like to get a return variant of `dynamic_sidebar`. There's no easy way to get a count of WordPress widgets. I figured out a way using a hook for widgets, but I was stopped in my tracks yet again because the widget hooks won't fire off until the widgets are outputted, which is when `dynamic_sidebar` is called. I need that count before calling `dynamic_sidebar`, but since it gets echoed out, I can't arrange the content appropriately without having to use `ob_` functions. In fact, in this scenario, to get my desired result, I had to call `dynamic_sidebar` twice, once in an output buffer to count them, and second time to show the content.
    22
    33NOTE: This is my first Core Trac comment, if I did anything wrong in contributing to this ticket.