widget_text_content

过滤钩子
apply_filters( 'widget_text_content', $text, $instance, $this )
参数
  • (string) $text The widget content.
    Required:
  • (array) $instance Array of settings for the current widget.
    Required:
  • (WP_Widget_Text) $widget Current Text widget instance.
    Required:
定义位置
相关勾子
widget_block_contentwidget_custom_html_contentwidget_textgettext_with_contextngettext_with_context
相关方法
get_the_contentget_the_content_feedget_theme_starter_contentthe_contenttranslate_with_gettext_contextget_url_in_content
引入
4.8.0
弃用
-

widget_text_content: 这是一个过滤器钩子,允许开发人员修改 WordPress 中文本小工具的内容,类似于widget_text. 然而,这个钩子是特定于小工具的内容的,可以用来修改内容而不影响小工具的任何其他方面。

对文本小工具的内容进行过滤,以应用视觉(TinyMCE)编辑器所期望的变化。

默认情况下,应用的是the_content过滤器的子集,包括wpautop和wptexturize。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$text = apply_filters( 'widget_text_content', $text, $instance, $this );
$text = apply_filters( 'widget_text_content', $text, $instance, $this );
$text = apply_filters( 'widget_text_content', $text, $instance, $this );

常见问题

FAQs
查看更多 >
闪电伯伯

(工作日 10:00 - 18:30 为您服务)

2025-11-02 00:19:49

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: