前言介紹
- 這款 WordPress 外掛「TinyMCE Custom Styles」是 2016-06-27 上架。
- 目前有 8000 個安裝啟用數。
- 上一次更新是 2024-06-29,距離現在已有 309 天。
- 外掛最低要求 WordPress 5.0 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
- 有 14 人給過評分。
- 論壇上目前有 1 個提問,問題解答率 0%
外掛協作開發者
rawrly | blackbam | tim-reeves |
外掛標籤
style | editor | format | visual | tinyMCE |
內容簡介
請有人接手維護這個外掛,否則它將會被遺棄 – 目前有超過9,000份活躍的安裝。
我現在已經68歲並退休了,並且我所有的時間都被其他項目佔用了,雖然我還有精力去做它們。您為什麼想要接手這個外掛?它真的很有用:
通過改善您使用TinyMCE視覺編輯器(包括Gutenberg Classic區塊)的方式,使您的編輯體驗盡可能簡單和良好。此外,此外掛還會向前端和TinyMCE編輯器添加自定義CSS文件;並允許您將TinyMCE的“格式”下拉菜單填充為自己的樣式。更詳細的功能如下:
1.將兩個CSS樣式表文件安裝到您選擇的位置(因此您仍然可以更新活躍的主題,此外掛,甚至切換到另一個主題)。通常,您需要通過FTP獲取自動創建的存根文件,本地進行編輯,然後上傳它們,覆蓋以前的版本。
editor-style.css用於設計TinyMCE編輯器
editor-style-shared.css用於前端和TinyMCE編輯器中使用的樣式(因此您不必複製)
要使用此功能,您必須在這些文件中編寫自己的CSS代碼。
2.此插件的主要功能是提供一個後端GUI,以動態方式為TinyMCE(“格式”下拉菜單)創建自定義樣式。
輕鬆添加,更改和刪除樣式
不需要編輯源代碼(除CSS樣式表之外)
允許您添加文本塊和內嵌元素,這些元素由TinyMCE未提供,例如,,等
該插件的後端頁面包含大量描述和一些鏈接,以幫助您正確定義自己的樣式
請注意,每個樣式都可以有CSS類和/或CSS內嵌樣式。後者(除顏色外)甚至將應用於格式下拉菜單項目。但是,我不建議內嵌樣式,因為它們被插入到帖子/頁面的文本中,如果您稍後在插件設置中更改樣式,那麼它們將保持不變 – 因此通常請使用類!
如何應用兩個樣式表
通過使用標准的WordPress函數wp_enqueue_style,將共享樣式表文件作為連接請求添加到前端頁面(通過
因此,與大多數其他樣式表一樣,其中的語句將自動應用於整個HTML頁面。因此定義類名,這些類名不會與主題已使用的任何類名發生衝突 - 除非您希望它們應用於該標記類型的所有元素(包括標頭,頁腳,側邊欄等)不要為沒有限制的類名定義樣式。
通過調用add_filter('mce_css',...),將兩個樣式表傳遞給TinyMCE。
這會導致將它們連接到HTML文檔中,該文檔是
Gutenberg經典區塊
從1.1.1版本開始,此外掛適用於Gutenberg經典區塊。
WordPress MultiSite
雖然它不檢查MultiSite,但是由於WordPress為每個MultiSite使用單獨的Options表,因此該外掛可以在MultiSite環境中工作。您可以重複使用相同的CSS文件(通過在每個站點提供相同的自定義目錄),或者為每個站點添加單獨的CSS樣式表。
當前語言
- en_US
- de_DE
原文外掛簡介
Please someone take over maintaining this plugin, or it will get abandoned – with over 9.000 active installations.
I’m now 69 and although retired, all my time is taken up with other projects, while I still have the energy for them. Why you might want to take it over? It’s really useful:
Make your editing experience as simple and good as possible by improving the way you work with the TinyMCE visual editor (including Gutenberg Classic block). This plugin adds custom CSS file(s) to the frontend and to the TinyMCE editor; and it allows you to populate TinyMCE’s ‘Formats’ dropdown with your own styles. The features in more detail:
1. Installs two CSS stylesheet files into your chosen location (so you can still do updates of the active theme and this plugin and even switch to another theme). In general you will need to fetch the auto-created stub files via FTP, edit them locally and upload them, overwriting the previous versions.
editor-style.css is used for styling your TinyMCE Editor
editor-style-shared.css is used for styles to be used by the frontend AND in your TinyMCE editor (so you do not have to copy)
To use this feature, you have to write your own CSS code into these files.
2. The main feature of this Plugin is to offer a Backend-GUI to create custom styles for TinyMCE (‘Formats’ dropdown) dynamically.
Easy to add, change and delete styles
No editing of source code required (excepting the CSS stylesheets)
Allows you to add block- and inline elements which are not provided by TinyMCE, e.g.
etc.
The plugin’s backend page contains a lot of description and some links to help you define your styles correctly
Note that each style can have both CSS Classes and/or CSS Inline-Styles. The latter (excepting color) will even be applied to the Formats dropdown menu items. However, I do not recommend inline styles as they are inserted into the text of the post/page and remain unchanged if you later alter the style in the plugin settings – so in general stick to Classes!How the two stylesheets are applied
area) using the standard WordPress function wp_enqueue_style.
The shared style sheet file is enqueued to be included on frontend pages (via the usual tag in the
So, as with most other stylesheets, the statements in it will automatically apply to the whole HTML page. So define class names which will not collide with any already in use by the theme – and do not define styles for HTML elements without a limiting class name unless you want them to apply to all elements of that tag type (including in header, footer, sidebar…).
Both stylesheets are passed to TinyMCE by calling: add_filter(‘mce_css’, …)
What this causes to happen is that they are linked in to the HTML document which is the source for an