WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 49 | * Filter the content of the Text widget. |
| 50 | * |
| 51 | * @since 2.3.0 |
| 52 | * @since 4.4.0 Added the `$this` parameter. |
| 53 | * |
| 54 | * @param string $widget_text The widget content. |
| 55 | * @param array $instance Array of settings for the current widget. |
| 56 | * @param WP_Widget_Text $this Current Text widget instance. |
| 57 | */ |
| 58 | $text = apply_filters( 'widget_text', $widget_text, $instance, $this ); |
| 59 | |
| 60 | echo $args['before_widget']; |
| 61 | if ( ! empty( $title ) ) { |
| 62 | echo $args['before_title'] . $title . $args['after_title']; |
| 63 | } ?> |
| 64 | <div class="textwidget"><?php echo !empty( $instance['filter'] ) ? wpautop( $text ) : $text; ?></div> |
| 65 | <?php |
| 66 | echo $args['after_widget']; |
| 67 | } |