WordPress at a glance
filter is not described

widget_text_content filter-hook . WP 4.8.0

Filters the content of the Text widget to apply changes expected from the visual (TinyMCE) editor.

By default a subset of the_content filters are applied, including wpautop and wptexturize.


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

	return $text;
The widget content.
Array of settings for the current widget.
Current Text widget instance.

Where the hook is called

wp-includes/widgets/class-wp-widget-text.php 292
$text = apply_filters( 'widget_text_content', $text, $instance, $this );

Where the hook is used (in WP core)

wp-includes/class-wp-embed.php 33
add_filter( 'widget_text_content', array( $this, 'run_shortcode' ), 8 );
wp-includes/class-wp-embed.php 40
add_filter( 'widget_text_content', array( $this, 'autoembed' ), 8 );
wp-includes/default-filters.php 205
add_filter( 'widget_text_content', 'capital_P_dangit', 11 );
wp-includes/default-filters.php 206
add_filter( 'widget_text_content', 'wptexturize' );
wp-includes/default-filters.php 207
add_filter( 'widget_text_content', 'convert_smilies', 20 );
wp-includes/default-filters.php 208
add_filter( 'widget_text_content', 'wpautop' );
wp-includes/default-filters.php 209
add_filter( 'widget_text_content', 'shortcode_unautop' );
wp-includes/default-filters.php 210
add_filter( 'widget_text_content', 'do_shortcode', 11 ); // Runs after wpautop(); note that $post global will be null when shortcodes run.