
內容簡介
在 WordPress 中,預設情況下如果處理任何特定短碼的外掛未啟用,或者短碼在內容中定義不當(如有打錯字),則相應的短碼會完整顯示在網站上,未被 WordPress 處理。最好情況下,這會向訪客顯示不美觀的代碼文本,而最糟糕的情況下,可能會洩露不應被訪客看到的信息。
本外掛可防止未處理的短碼出現在一篇文章或網頁的內容中。如果該短碼為自閉合型,則不會顯示短碼標籤及其屬性,而在它們的位置上不顯示任何內容。如果该短码为闭合型(在一段文本或标记的开闭标签中夹着文本或标记),则将显示被夹着的文本,但不会显示短码标记和属性。
更多自定義提示,請參閱「過濾器」部分。
連結:外掛首頁 | 外掛目錄頁面 | GitHub | 作者首頁
開發人員文件
開發人員文件可在DEVELOPER-DOCS.md中找到。該文件涵蓋外掛提供的鉤子(hooks)。
概述地說,此外掛提供以下鉤子:
hide_broken_shortcode:自定義當出現無法處理的短碼時,要顯示的內容(如果有的話)。
hide_broken_shortcodes_filters:自定義要使用的過濾器,以查找具有潛在破碎短碼的文本。
外掛標籤
開發者團隊
原文外掛簡介
By default in WordPress, if the plugin that provides the functionality to handle any given shortcode is disabled, or if a shortcode is improperly defined in the content (such as with a typo), then the shortcode in question will appear on the site in its entirety, unprocessed by WordPress. At best this reveals unsightly code-like text to visitors and at worst can potentially expose information not intended to be seen by visitors.
This plugin prevents unhandled shortcodes from appearing in the content of a post or page. If the shortcode is of the self-closing variety, then the shortcode tag and its attributes are not displayed and nothing is shown in their place. If the shortcode is of the enclosing variety (an opening and closing tag bookend some text or markup), then the text that is being enclosed will be shown, but the shortcode tag and attributes that surround the text will not be displayed.
See the Filters section for more customization tips.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
Developer Documentation
Developer documentation can be found in DEVELOPER-DOCS.md. That documentation covers the hooks provided by the plugin.
As an overview, these are the hooks provided by the plugin:
hide_broken_shortcode : Customizes what, if anything, gets displayed when a broken shortcode is encountered.
hide_broken_shortcodes_filters : Customizes what filters to hook to find text with potential broken shortcodes.
