Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: widget_custom_html_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
153           /**
154            * Filters the content of the Custom HTML widget.
155            *
156            * @since 4.8.1
157            *
158            * @param string                $content  The widget content.
159            * @param array                 $instance Array of settings for the current widget.
160            * @param WP_Widget_Custom_HTML $widget   Current Custom HTML widget instance.
161            */
162           $content = apply_filters( 'widget_custom_html_content', $content, $instance, $this );
163
164           // Restore post global.
165           $post = $original_post;
166           remove_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );
167
168           // Inject the Text widget's container class name alongside this widget's class name for theme styling compatibility.
169           $args['before_widget'] = preg_replace( '/(?<=\sclass=["\'])/', 'widget_text ', $args['before_widget'] );
170
171           echo $args['before_widget'];