4

Is there one last filter that is ran over the widgets before they are sent out to the browser? I would like to add a filter that adds rel="nofollow" to all links in all widgets.

For instance, I can add a filter to the text widget:

add_filter('widget_text', 'xrvel_nfp_modify_nofollow');

But I don't want to hunt down every single hook for every widget. (Also, the RSS widget doesn't even HAVE a filter. Trac ticket submitted)

2

There is another thread on here that discusses a workaround.

Well... the familiar php workaround when a function does not provide a "get to variable" output actually... use ob_start: http://php.net/manual/en/function.ob-start.php to just capture the output and manipulate it before sending it on its way.

Leads on stackoverflow: https://stackoverflow.com/search?q=%2Bwordpress+sidebar+%2Bob-start+

2

The output is completely up to each individual widget. It is echoed directly by the widget's widget() method, so there's no general filters that apply to all of them.

  • That's poop. I was afraid that was the case. – Dan Gayle Feb 24 '11 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.