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