Filters the content of the Text widget.
Parameters
$text
string- The widget content.
$instance
array- Array of settings for the current widget.
$widget
WP_Widget_Text|WP_Widget_Custom_HTML- Current text or HTML widget instance.
Source
$text = apply_filters( 'widget_text', $text, $instance, $this );
Example migrated from Codex:
The following performs a string replace on the content of the Text widget.