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
檢視更多 >