widget_text_content WordPress Filter Hook

The widget_text_content hook is used to filter the content of a text widget before it is displayed. This hook can be used to modify the content of a text widget, or to add extra content to a text widget.

apply_filters( 'widget_text_content', string $text, array $instance, WP_Widget_Text $widget ) #

Filters the content of the Text widget to apply changes expected from the visual (TinyMCE) editor.


Description

By default a subset of the_content filters are applied, including wpautop and wptexturize.


Top ↑

Parameters

$text

(string)The widget content.

$instance

(array)Array of settings for the current widget.

$widget

(WP_Widget_Text)Current Text widget instance.


Top ↑

Source

File: wp-includes/widgets/class-wp-widget-text.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.