wphooks.info - widget_text_content

widget_text_content

*** New in v4.8 ***

The hook occurs in the following file:

wp-includes/widgets/class-wp-widget-text.php:
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
				 * 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.
				 *
				 * @since 4.8.0
				 *
				 * @param string         $text     The widget content.
				 * @param array          $instance Array of settings for the current widget.
				 * @param WP_Widget_Text $this     Current Text widget instance.
				 */
				$text = apply_filters( 'widget_text_content', $text, $instance, $this );

			} elseif ( $instance['filter'] ) {
				$text = wpautop( $text ); // Back-compat for instances prior to 4.8.
			}
		}

		echo $args['before_widget'];
		if ( ! empty( $title ) ) {
			echo $args['before_title'] . $title . $args['after_title'];