前言介紹
- 這款 WordPress 外掛「Priority Shortcodes」是 2014-09-19 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2024-04-15,距離現在已有 383 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 2.5.0 以上版本才可以安裝。
- 有 1 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
tinyMCE | shortcodes | classic editor |
內容簡介
你是否曾經因 TinyMCE+wpautop+do_shortcode 而感到煩惱或挫敗,它們會破壞你的簡碼 (shortcode),將
標籤包裹在
Priority Shortcodes 的運作方式是在 the_content 和 widget_text 鉤子上添加一個具有優先順序高於 wpautop 和 do_shortcode 的動作。結果是,這些其他動作會運行你的簡碼最終輸出,而不是嘗試猜測它是否應該包裹在
標籤中等。
Codex 說明:
wpautop 認識簡碼語法,並會嘗試不在簡碼前後包裹 p 或 br 標籤。這種方式下的簡碼應確保輸出會被包裹在適當的區塊標籤(例如
或
但有時簡碼會站在自己的一行上,懇切地希望被包裹在段落標籤中,有時則不希望。比如生成帶有一些類別的 標籤的簡碼。(是的,你可能會想使用自訂 TinyMCE 樣式,而不是一個簡單的 span 標籤)。
使用方法
當你想要設定具有優先順序的簡碼時,請在起始處使用 '“[!',例如[my-shortcode]成為[!my-shortcode],[my-shortcode]Some content.[/my-shortcode]成為[!my-shortcode]Some content.[/my-shortcode]。
Gutenberg
新的 WordPress 編輯器「Gutenberg」的使用者可能不會在新編輯器中使用 Priority Shortcodes,但該外掛程式仍可在經典編輯器中使用。
原文外掛簡介
Intended for use with the Classic Editor plugin.
Ever get annoyed or frustrated by the way TinyMCE+wpautop+do_shortcode wreak havoc on your shortcodes, wrapping
s around
s, and all sorts of craziness? This plugin allows you to specify shortcodes to be processed before those other actions, generating the clean code you expected.
Priority Shortcodes works by adding an action to the_content and widget_text hooks with a higher priority than wpautop and do_shortcode. The result is that those other actions run your shortcode’s final output, rather than trying to guess if it should be wrapped in
tags, etc.
The Codex says:
wpautop recognizes shortcode syntax and will attempt not to wrap p or br tags around shortcodes that stand alone on a line by themselves. Shortcodes intended for use in this manner should ensure that the output is wrapped in an appropriate block tag such as
or
But sometimes shortcodes stand on their own on a line, wanting desperately to be wrapped in a paragraph tag, and sometimes they don’t. Like a shortcode that generates a tag with some classes. (Yeah, you might want to use custom TinyMCE styles instead for a simple span.)
Usage
Where you want to process a shortcode with priority, use “[!” at the start. For example: [my-shortcode] becomes [!my-shortcode] and [my-shortcode]Some content.[/my-shortcode] becomes [!my-shortcode]Some content.[/my-shortcode].
Gutenberg
Users of the new WordPress editor, “Gutenberg”, will probably not use Priority Shortcodes within the new editor, but the plugin continues to work in the Classic Editor.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Priority Shortcodes」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Classic Editor 》Classic Editor 是由 WordPress 團隊維護的官方外掛程式,可還原之前(也就是「經典」)的 WordPress 編輯器和「編輯文章」畫面,使使用者可以使用延伸這個畫...。
Advanced Editor Tools 》高級編輯工具(以前稱為 TinyMCE Advanced)引入了一個「經典段落」區塊,供區塊編輯器(Gutenberg)使用。, 如果您還沒有準備好切換到區塊編輯器,或者有插...。
Disable Gutenberg 》此外掛可禁用新的 Gutenberg 編輯器 (也稱為區塊編輯器),並以經典編輯器取代它。你可以完全禁用 Gutenberg,或從文章、頁面、角色、文章類型和主題模板中有...。
Classic Editor + 》, 符合 GDPR 規範:不收集任何使用者資料, , 這個免費的「Classic Editor +」外掛程式針對不想使用 WordPress 5.0 引入的 WP Block Editor(Gutenberg)的所...。
No Gutenberg – Disable Gutenberg Blocks Editor and FSE Global Styles 》WordPress 5.x 內建了一個名為 Gutenberg 的新區塊編輯器。隨著 5.9 版本的推出,全站編輯(Full Site Editing,FSE)的全局樣式被加入,每個頁面都會載入大...。
Enlighter – Customizable Syntax Highlighter 》Enlighter 是一款免費且易於使用的 WordPress 語法高亮工具。其語法高亮效果是由 EnlighterJS javascript 函式庫所提供,能呈現出漂亮的程式碼外觀。, 您可以...。
Classic Editor and Classic Widgets 》這個免費的 Classic Editor & Classic Widgets 外掛可幫助您輕鬆地完全停用 Gutenberg 編輯器,並啟用 Classic Editor 和 Classic Widgets。, Classic Ed...。
Enable Classic Editor & Widgets 》這是一個非常輕量化的經典編輯器外掛程式,僅佔用 3KB。隨著 WordPress 5.x 的推出,我們也迎來了一個全新的區塊編輯器─Gutenberg。由於相容性及易用性的考量...。
Remove Gutenberg 》您是否已升級 WordPress,但卻卡在新的編輯器上?別擔心,只要安裝Remove Gutenberg外掛程式,就可以使用經典編輯器。此外,閱讀設定中還有一個功能,可以啟...。
Web Fonts Loader – Google Fonts Manager 》這個 WordPress 外掛將熱門的 Google 字型載入到你的網站中,你可以將這些字型應用到整個網站,或是分別應用在每個頁面或文章中。, 當你安裝並啟用外掛後,你...。
Quicktags for WP 》這個簡單的外掛程式為 WordPress 的 HTML 編輯器增加有用的按鈕。, 目前它可以新增以下按鈕:, h1、h2、h3、h4、h5、hr、nbsp、mox, mox 按鈕可以新增一個漂...。
DivUp Content 》注意:此外掛原本是為了解決將傳統編輯器內容分割成 div,使用簡短代碼的問題。於 2022 年 9 月 27 日,我測試了此外掛與 Gutenberg 的相容性,因為 div 在 G...。
Guten Free Options 》是否想要根據自身需要使用或不使用新的區塊編輯器(Gutenberg)?, Guten Free Options 可以讓您完全控制文章何時需要使用傳統編輯器或區塊編輯器,使您平滑...。
TCD Classic Editor 》總結:該外掛讓你可以在經典編輯器中新增自訂的快速標籤,同時使用了第三方服務 Google Maps API 來嵌入地圖。, , 問題與答案:, 1. 這個 WordPress 外掛的功...。
WP Disable Block Editor 》這個外掛可以讓您停用 WordPress 區塊編輯器並啟用經典編輯器以及原始的「編輯文章」畫面(包括 TinyMCE、元箱等等)。, , 停用區塊編輯器,啟用舊版編輯器。...。