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
53            * Filter the content of the Text widget.
54            *
55            * @since 2.3.0
56            * @since 4.4.0 Added the `$this` parameter.
57            *
58            * @param string         $widget_text The widget content.
59            * @param array          $instance    Array of settings for the current widget.
60            * @param WP_Widget_Text $this        Current Text widget instance.
61            */
62           $text = apply_filters( 'widget_text', $widget_text, $instance, $this );
63
64           echo $args['before_widget'];
65           if ( ! empty( $title ) ) {
66                echo $args['before_title'] . $title . $args['after_title'];
67           } ?>
68                <div class="textwidget"><?php echo !empty( $instance['filter'] ) ? wpautop( $text ) : $text; ?></div>
69           <?php
70           echo $args['after_widget'];
71      }