widget_text

過濾鉤子
apply_filters( 'widget_text', $instance['content'], $simulated_text_widget_instance, $this )

widget_text:這是一個過濾器鉤子,允許開發人員修改 WordPress 中文字小工具的內容。文字小工具是一個基本小工具,允許使用者將 HTML 和文字新增到小工具就緒區域,例如側邊欄。通過使用這個鉤子,開發人員可以在文字小工具顯示在網站上之前修改它的內容。

這個過濾器在wp-includes/widgets/class-wp-widget-text.php中有所記載。

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

常見問題

FAQs
檢視更多 >