[WordPress] 外掛分享: SVG Forge Icon Manager

首頁外掛目錄 › SVG Forge Icon Manager
全新外掛
安裝啟用
尚無評分
剛更新
最後更新
問題解決
WordPress 6.6+ PHP 8.3+ v0.3.3 上架:2026-09-18

內容簡介

SVG Forge Icon Manager 外掛提供一個集中管理 SVG 圖示的解決方案,讓開發者能夠輕鬆插入自訂的 SVG 圖示,並確保其性能與可控性。此外掛適合進階的佈景主題與外掛開發者,能夠有效管理和使用 SVG 圖示。

【主要功能】
• 集中管理 SVG 圖示庫
• 快速插入 SVG 圖示至內容
• 支援自訂顏色與大小設定
• 版本控制與緩存優化
• 兼容 WordPress 7.1 的圖示系統

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.3.3) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「SVG Forge Icon Manager」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

The Icon Library Block loads a central SVG sprite file (by default the bundled sprite.svg), shows all contained elements in a convenient picker and inserts the selected icon as into your content.
The SVG fragment is rendered on the server, so visitors receive fast, static HTML with no extra requests and no JavaScript on the frontend. Since you own the sprite file, every icon stays small, cacheable and fully under your control — exactly the way a hand-built icon set should be maintained.
Who is this plugin for?
This plugin is primarily aimed at advanced theme and plugin developers. It does not give you a code-free icon manager: every icon must first exist as a in a sprite file that you own, build and version.
Since WordPress 7.1, core ships its own icon system (wp_register_icon_collection(), wp_register_icon(), wp_get_icon()): icons then automatically appear in the native Icon block’s picker and in the REST API, and can be rendered directly in PHP. If you only need a few icons and can register them in code, use core instead — this plugin is then unnecessary.
The fragment approach has advantages when you run a real sprite pipeline:

Full SVG via : stroke-based icons, gradients, currentColor, inline styles and custom viewBox values survive. WordPress 7.1’s sanitizer only allows , and (no stroke, no inline styles) and therefore breaks many stroke-based icon sets.
Reuse existing sprites: generate a sprite with svgforge-cli (sanitization + svgo optimization) and upload it — no per-icon PHP code required.
One file: the sprite is a single cacheable file that lives in the theme repo and is versioned with Git.
Control per block: fill and stroke colours, size (standard Dimensions panel with preset slider + custom input), links with rel handling and aria-labels — per icon instance, without touching a stylesheet.
Also runs on WordPress versions before 7.1 (from 6.6).

Limitations you should know about:

To add or change icons you have to rebuild the sprite file — typically with svgforge-cli, which handles sanitization and svgo optimization. There is no in-browser icon editor or management UI.
The icons live in your content as a block. There is no replacement for the simple wp_get_icon() helper in theme PHP — that is what the native 7.1 approach is for.

Features

Settings page (Settings → Icon Library) to upload the SVG sprite file — svgforge-cli handles full sanitization and svgo optimization, the plugin strips scripts, event handlers and javascript: links as a safety net.
Theme override via the sfim_sprite_url filter (e.g. get_theme_file_uri()) – the filter has priority over everything.
Symbol picker in the editor with a live preview of all icons from the sprite; icons from sprite subdirectories (IDs like directory--filename) are grouped and selectable via a filter in the dropdown.
Icons can be linked (new tab + rel attributes including noopener/noreferrer).
Aria-label for screen readers; linked icons are automatically labelled via the link.
Fill and stroke colour as well as size per block (square, preset slider + custom input with units).
Fully dynamic server-side rendering (render.php) with get_block_wrapper_attributes().
Block supports: alignment, anchor, additional CSS classes.

Configure the sprite file
The SVG sprite file is resolved in this order (first existing source wins):

Filter sfim_sprite_url – the canonical override (has priority).
Uploaded file from Settings → Icon Library (backend upload).
Fallback: sprite.svg in the plugin directory.

Override with a filter (recommended, versionable with the theme) in the theme’s functions.php:
add_filter( 'sfim_sprite_url', fn () => get_theme_file_uri( 'assets/ico.svg' ) );

or point it at a CDN:
add_filter( 'sfim_sprite_url', fn () => 'https://cdn.example.com/icons/ico.svg' );

Icon Library is a developer-focused Gutenberg block that arranges a curated set of SVG icons as one central sprite and reuses them everywhere in your content. It works with any symbol sprite produced by modern build tools, is fully translated, and gives you precise control over colours, size, links and accessibility on every single block instance. The plugin prefers simplicity and performance: no tracking, no external requests, no page-weight overhead, and no vendor lock-in to a particular icon pack or service.
Development
Development is done on GitHub.

延伸相關外掛

文章
Filter
Mastodon