apply_filters( 'widget_text', string $text , array $instance , WP_Widget_Text|WP_Widget_Custom_HTML $this )
Filters the content of the Text widget.
Parameters Parameters
- $text
-
(string) The widget content.
- $instance
-
(array) Array of settings for the current widget.
- $this
-
(WP_Widget_Text|WP_Widget_Custom_HTML) Current Text widget instance.
More Information 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 Source
Changelog Changelog
Version | Description |
---|---|
4.8.1 | The $this param may now be a WP_Widget_Custom_HTML object in addition to a WP_Widget_Text object. |
4.4.0 | Added the $this parameter. |
2.3.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example migrated from Codex:
The following performs a string replace on the content of the Text widget.