Is There A Hook To Process The Content Of The Text Widget?

Filter

  1. widget_text (for the text)
  2. widget_title (for the title)

Example

function add_smiley($content) {
$new_content="";
$new_content.= $content . ':)';
return $new_content;
}   
add_filter('widget_text', 'add_smiley');

Note that this works only for the content so not if you have a widget with only a title.

Reference

  1. http://codex.wordpress.org/WordPress_Widgets
  2. https://stackoverflow.com/questions/1385954/do-wordpress-widget-or-sidebar-hooks-exist
  3. https://stackoverflow.com/search?q=wordpress+widget

Leave a Comment