Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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)

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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: http://stackoverflow.com/search?q=%2Bwordpress+sidebar+%2Bob-start+

share|improve this answer

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.

share|improve this answer
    
That's poop. I was afraid that was the case. –  Dan Gayle Feb 24 '11 at 21:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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