[WordPress] 外掛分享: JVM Rich Text Icons

WordPress 外掛 JVM Rich Text Icons 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「JVM Rich Text Icons」是 2021-03-19 上架。
  • 目前有 3000 個安裝啟用數。
  • 上一次更新是 2026-02-23,距離現在已有 3 天。
  • 外掛最低要求 WordPress 5.4 以上版本才可以安裝。
  • 有 10 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

jorisvanmontfort |

外掛標籤

SVG | icon | gutenberg | icon-block | Font Awesome |

內容簡介

這款外掛可以在 Gutenberg 區塊編輯器中的段落、標題、清單或按鈕等豐富文字區塊中添加內嵌圖示。該外掛以免費的 Font Awesome 圖示集作為預設圖示集。您可以在版本 4.x、5.x 和版本 6.x 之間進行選擇。
此外掛還提供了一個易於使用的介面,可基於 SVG 圖示創建自定義圖示集。可以使用簡單易用的拖放上傳器從外掛設置中上傳自定義圖示。

此外,外掛還為 Advanced Custom Fields (ACF) 創建了一種新的字段類型:JVM 圖示字段。現在,您可以創建與 Font Awesome 圖示集或甚至更好的自定義圖示集配合使用的自定義字段。

如果 Font Awesome 或內置的自定義圖示集配置器不滿足您的需求,您也可以創建自己的自定義圖示集並使用外掛提供的 Hooks 加載它。

外掛只是以以下 HTML 格式插入圖示:

<i class="icon fa fa-address-book" aria-hidden="true"> </i>

如果您準備為 WordPress 主題編寫一些 PHP Hooks,則可以將 CSS 類名和可用圖示全部進行修改,但請注意,您應將外掛設置保持為使用「Font Awesome 4.7」。

如果您想加載自己製作的自定義網頁字體或圖示集,請繼續閱讀。您可以通過從外掛設置中設置為「自定義 SVG 圖示集」並從外掛設置中上傳 SVG 文件來實現此目的。

CSS 文件
默認情況下,前端和後端都會加載 Font Awesome 4.7 的略微自定義版本的 CSS 文件,以便使外掛能夠直接運行,但您也可以從設置屏幕中選擇 Font Awesome Free 版本 5.x 或 6.x。
如果您想使用自己製作的圖示集,建議您使用外掛提供的 Hooks 覆蓋圖示集 json 文件和 CSS 文件。

自定義圖示集文件
如果外掛設置為 Font Awesome 4.7 圖示集(預設行為),則圖示將從 wp-content/plugins/jvm-richtext-insert-icons/dist/fa-4.7/icons.json 加載。json 文件包含所有可由 Font Awesome 4.7 CSS 文件轉換為圖示的 css 類。您可以在 (子)主題 functions.php 中調用過濾器呼叫自定義 json 圖示集文件。
例如:

function add_my_icons($file) {
$file = get_stylesheet_directory() .'/path_to_my/icons.json';
return $file;
}

add_filter( 'jvm_richtext_icons_iconset_file', 'add_my_icons');

自從版本 1.0.3 起,圖示配置文件也可以是 fontello 格式。請參閱:https://fontello.com以創建您的自定義圖示集。

自定義 CSS 文件
默認情況下,外掛會從 wp-content/plugins/jvm-richtext-insert-icons/dist/fa-4.7/font-awesome.min.css 加載 Font Awesome 4.7 CSS。您可以在 (子) 主題 functions.php 中調用過濾器呼叫自定義 CSS 文件以供您的圖示集使用。
例如:

function add_my_css($cssfile) {
$cssfile = get_stylesheet_directory_uri() .'/path_to_my/cssfile.css';
return $cssfile;
}

add_filter( 'jvm_richtext_icons_css_file', 'add_my_css');

如果您選擇加載自己的 CSS 文件並想要禁用默認 CSS 文件,請使用以下代碼:

add_filter( 'jvm_richtext_icons_css_file', '__return_false');

所有圖示標記都在插入圖示時添加了 classname「icon」。如果您想使用其他前綴,可以添加過濾器。例如:

function my_icon_class($css_class_name) {
return 'my-custom-css-class-name';
}

add_filter( 'jvm_richtext_icons_classname', 'my_icon_class');

原文外掛簡介

Add icons to any rich text field in the WordPress block editor. Insert icons inline in paragraphs, headings, lists, buttons, or use the dedicated single icon block.
Features

Icon picker – Select icons from a searchable popup in the block editor toolbar.
Font Awesome included – Ships with Font Awesome 4.7, 5.x and 6.x. Choose your preferred version from the settings.
Custom SVG icon set – Upload your own SVG icons via a drag & drop uploader in the plugin settings. This is the recommended approach for the best performance.
Single icon block – A dedicated block with font size, color, alignment and spacing options.
ACF integration – Adds a “JVM Icon” field type for Advanced Custom Fields.

See it in action
How it works
Pick an icon from the toolbar while editing any rich text field. The plugin inserts a small HTML tag that gets styled by the chosen icon set.
Why use a custom SVG icon set?
When you use a custom SVG icon set, the plugin defaults to inline SVG rendering. This is a great choice for performance! Google PageSpeed Insights will thank you.

Better page speed – No render-blocking CSS or font files to download. Icons are part of the HTML itself.
Only loads what you use – Unlike Font Awesome which loads CSS for hundreds of icons, inline SVG only includes the icons that are actually on the page.
No external requests – Everything is served inline, so there are no extra HTTP requests for font or CSS files.
Inherits text color – Icons automatically use the surrounding text color, no extra CSS needed.
Fully reversible – The stored content in the database is not modified. You can switch between render technologies at any time from the plugin settings if you want to.

Alternative render technologies (CSS masks, ::before / ::after pseudo-elements) are also available for custom SVG icons if your use case requires it.
For developers
The plugin provides several filter hooks to customize its behavior. You can load your own icon set, CSS file, or change the icon class prefix.
Load a custom icon set file
add_filter( 'jvm_richtext_icons_iconset_file', function($file) {
return get_stylesheet_directory() . '/path_to_my/icons.json';
});

Load a custom CSS file
add_filter( 'jvm_richtext_icons_css_file', function($cssfile) {
return get_stylesheet_directory_uri() . '/path_to_my/cssfile.css';
});

To disable the default CSS file entirely:
add_filter( 'jvm_richtext_icons_css_file', '__return_false');

Change the icon class prefix
add_filter( 'jvm_richtext_icons_base_class', function() {
return 'my-custom-css-class-name';
});

Disable the settings screen
add_filter( 'jvm_richtext_icons_show_settings', '__return_false');

Please note that if you are loading a custom icon set with the plugin hook: jvm_richtext_icons_css_file, you should make sure the plugin is not set to My SVG uploads as this setting does not load any CSS file.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「JVM Rich Text Icons」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.6.2 | 1.6.3 | 1.6.4 | 1.6.5 | 1.6.6 | trunk |

延伸相關外掛(你可能也想知道)

  • Classic Editor 》Classic Editor 是由 WordPress 團隊維護的官方外掛程式,可還原之前(也就是「經典」)的 WordPress 編輯器和「編輯文章」畫面,使使用者可以使用延伸這個畫...。
  • Advanced Editor Tools 》高級編輯工具(以前稱為 TinyMCE Advanced)引入了一個「經典段落」區塊,供區塊編輯器(Gutenberg)使用。, 如果您還沒有準備好切換到區塊編輯器,或者有插...。
  • Classic Widgets 》Classic Widgets 是由 WordPress 團隊維護的官方外掛,能夠恢復先前(即「經典」)的 WordPress widgets 設定畫面。該外掛將於 2024 年或必要時保持支援和維...。
  • Starter Templates – AI-Powered Templates for Elementor & Gutenberg 》免費模板,支援 Elementor、Beaver Builder 和 Block Editor, 使用 Starter Templates 外掛,只需數分鐘即可建立專業且完美的網站。此外掛為使用者提供超過 2...。
  • Spectra Gutenberg Blocks – Website Builder for the Block Editor 》a.com/tutorials/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme" rel="nofollow ugc">Spectra tutorials, you can easily learn how to ...。
  • Kadence Blocks — Page Builder Toolkit for Gutenberg Editor 》Kadence Blocks 是一個 WordPress 外掛,它附加自訂區塊和選項,擴展了 Gutenberg 編輯功能,使您能夠輕鬆創建美麗的網站,而不需要任何程式編寫。Kadence Bl...。
  • Disable Gutenberg 》此外掛可禁用新的 Gutenberg 編輯器 (也稱為區塊編輯器),並以經典編輯器取代它。你可以完全禁用 Gutenberg,或從文章、頁面、角色、文章類型和主題模板中有...。
  • Extendify 》Extendify 是一個網站設計和製作工具平台,提供豐富的圖案和全頁面佈局,可用於 Gutenberg 區塊編輯器,幫助人們建立美麗的 WordPress 網站。, 使用 Extendif...。
  • Otter Blocks – Gutenberg Blocks, Page Builder for Gutenberg Editor & FSE 》Otter 是一款 Gutenberg Blocks 頁面建構外掛,可為 WordPress Block Editor(又稱 Gutenberg)添加額外功能,讓您享受更好的頁面建構體驗,而無需使用傳統的...。
  • Page Builder Gutenberg Blocks – CoBlocks 》, 注意:對於已受 CoBlocks 3.0.0 版本影響的使用者,請查看我們在 WordPress.org 支援論壇文章,如果您需要支援,請建立新的主題帖。, , CoBlocks 是新版 Gu...。
  • AI Powered Starter Templates by Kadence WP 》用三個滑鼠點擊建立一個美觀的「效能優化」網站, 在幾分鐘內創建和自定義專業設計的網站。, Kadence Starter Templates 為您提供使用 WordPress 區塊構建器的...。
  • GenerateBlocks 》將不同的功能整合至編輯器,但並不會因為過多的一維方塊造成內容過於臃腫。使用 GenerateBlocks,您只需深入學習少量的方塊,即可用於創建任何內容。, Genera...。
  • Gutenberg Essential Blocks – Page Builder for Gutenberg Blocks & Patterns 》使用 Essential Blocks for Gutenberg,即可實現您的創意視覺效果,這是適用於 WordPress 的最終區塊庫!, 使用我們易於使用的區塊,增強您使用 Gutenberg 的...。
  • VK Blocks 》這是一個擴充 Gutenberg 模塊的外掛。, [ 模塊 ], , 成員, 外框, 警示, 常問問題, 氣球, 流, 按鈕, 公關模塊, 公關內容, 邊框盒, 標題(帶副標題), 響應間距...。
  • Stackable – Page Builder Gutenberg Blocks 》終極與古鐸版衣搭檔, Stackable 是您一直在等待的終極可靠古鐸版衣搭檔。使用堅強、輕便的自訂區塊、現成設計、UI套件、全域設定和高級自訂選項建立動態網站...。

文章
Filter
Apply Filters
Mastodon