Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: widget_text_content

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
276                 *
277                 * By default a subset of the_content filters are applied, including wpautop and wptexturize.
278                 *
279                 * @since 4.8.0
280                 *
281                 * @param string         $text     The widget content.
282                 * @param array          $instance Array of settings for the current widget.
283                 * @param WP_Widget_Text $this     Current Text widget instance.
284                 */
285                $text = apply_filters( 'widget_text_content', $text, $instance, $this );
286           } else {
287                // Now in legacy mode, add paragraphs and line breaks when checkbox is checked.
288                if ( ! empty( $instance['filter'] ) ) {
289                     $text = wpautop( $text );
290                }
291
292                /*
293                 * Manually do shortcodes on the content when the core-added filter is present. It is added by default
294                 * in core by adding do_shortcode() to the 'widget_text_content' filter to apply after wpautop().