WordPress at a glance
filter is not described

widget_text filter-hook . WP 2.3.0

Filters the content of the Text widget.

Usage

add_filter( 'widget_text', 'filter_function_name_1712', 10, 3 );
function filter_function_name_1712( $text, $instance, $this ){
	// filter...

	return $text;
}
$text(string)
The widget content.
$instance(array)
Array of settings for the current widget.
$this(WP_Widget_Text/WP_Widget_Custom_HTML)
Current Text widget instance.

Notes

  • Since 4.4.0 Added the $this parameter.
  • Since 4.8.1 The $this param may now be a WP_Widget_Custom_HTML object in addition to a WP_Widget_Text object.

Where the hook is called

WP_Widget_Text::widget()
widget_text
WP_Widget_Custom_HTML::widget()
widget_text
wp-includes/widgets/class-wp-widget-text.php 270
$text = apply_filters( 'widget_text', $text, $instance, $this );
wp-includes/widgets/class-wp-widget-custom-html.php 141
$content = apply_filters( 'widget_text', $instance['content'], $simulated_text_widget_instance, $this );

Where the hook is used (in WP core)

wp-includes/widgets/class-wp-widget-text.php 243
remove_filter( 'widget_text', 'do_shortcode', $widget_text_do_shortcode_priority );
wp-includes/widgets/class-wp-widget-text.php 314
add_filter( 'widget_text', 'do_shortcode', $widget_text_do_shortcode_priority );
wp-includes/default-filters.php 191
add_filter( 'widget_text', 'balanceTags' );