Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: widget_text

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
73            * Filters the content of the Text widget.
74            *
75            * @since 2.3.0
76            * @since 4.4.0 Added the `$this` parameter.
77            *
78            * @param string         $text     The widget content.
79            * @param array          $instance Array of settings for the current widget.
80            * @param WP_Widget_Text $this     Current Text widget instance.
81            */
82           $text = apply_filters( 'widget_text', $text, $instance, $this );
83
84           if ( isset( $instance['filter'] ) ) {
85                if ( 'content' === $instance['filter'] ) {
86
87                     /**
88                      * Filters the content of the Text widget to apply changes expected from the visual (TinyMCE) editor.
89                      *
90                      * By default a subset of the_content filters are applied, including wpautop and wptexturize.
91                      *