On this page
apply_filters( 'widget_text', string $text, array $instance, WP_Widget_Text|WP_Widget_Custom_HTML $widget )
Filters the content of the Text widget.
Parameters
$textstring-
The widget content.
$instancearray-
Array of settings for the current widget.
$widgetWP_Widget_Text|WP_Widget_Custom_HTML-
Current text or HTML widget instance.
More Information
May also apply to some third party widgets as well. This filter hook can be used to replace any text within sidebar widgets.
Source
File: wp-includes/widgets/class-wp-widget-text.php. View all references
$text = apply_filters( 'widget_text', $text, $instance, $this );
Related
Used By
| Used By | Description |
|---|---|
| WP_Widget_Custom_HTML::widget() wp-includes/widgets/class-wp-widget-custom-html.php | Outputs the content for the current Custom HTML widget instance. |
| WP_Widget_Text::widget() wp-includes/widgets/class-wp-widget-text.php | Outputs the content for the current Text widget instance. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/widget_text