Output Buffering Bug
-
I attempted to use this widget in a theme that is using output buffering and it is not playing nicely. In my case, the other widgets were being output at completely random parts of the page (outside of the sidebar).
The issue is here:
if ($cache) { $cache[$args['widget_id']] = ob_get_flush(); }
You’re not always clearing the buffer, and when you are, you’re clearing ALL buffers. I was able to fix by replacing with this:
$widget_output = ob_get_clean(); if ($cache) { $cache[$args['widget_id']] = $widget_output; } echo $widget_output;
That way, it always cleans up when it’s done and doesn’t interfere with any external output buffers.
- The topic ‘Output Buffering Bug’ is closed to new replies.