內容簡介
這個簡單的外掛程式是為了解決使用 PHP preg_replace 直接替換字串所引起的安全性問題,並建議在轉換到 PHP7 後改用 preg_replace_callback 。
這個外掛程式使用內建支援的 PHP “highlight_string” 功能,篩選文章內的自定義 HTML 區塊內容,並幫助顯示 HTML 和其他原始碼。
為了在文章中顯示原始碼,請使用 pre 標籤圍住原始碼。本外掛程式將篩選 pre 標籤並添加內嵌樣式,這些樣式可以使用您的 WordPress 主題 CSS 樣式表進行修改。
對於 WordPress 的 5.0 以上版本,HTML pre 標籤可以在 HTML 區塊或經典區塊中使用。當您在編輯文章時遇到無效內容錯誤時,可以使用三個點的選單轉換為 HTML。
外掛標籤
開發者團隊
原文外掛簡介
This simple plugin was created because of security concerns related to using PHP preg_replace directly. With transition to PHP7, it’s advised to use preg_replace_callback instead.
This plugin uses built-in supported feature of PHP-“highlight_string”. This plugin filters post content inside custom html block for
and helps display html and other source code.
To display source code in your posts, surround source code with pre tags. Plugin will filter for pre tags and add inline styles that may be modified using your wordpress theme’s css stylesheet.
For WordPress versions 5.0 and above, HTML pre tags can be used within html block or, classic block. Use the three dot menu to convert to html when there is a invalid content error while post editing.
