s3rgiosan/icons-extended
Composer 安装命令:
composer require s3rgiosan/icons-extended
包简介
README 文档
README
Extends the Icon block with custom icons and the ability to remove registered icons.
Register custom SVG icons against the core core/icon block via a stable PHP API, and remove icons (including the ones that ship with WordPress) from the registry. Changes are served through the existing Gutenberg icon picker. See docs/icons.md for the full guide.
Looking for inline icons in rich-text fields? See my Outstand Icons plugin.
Features
Custom icons
Register your own SVG icons against the core core/icon block through a stable PHP API (s3s_register_icon() or the s3s_icons_registry filter). Icons are validated at registration time and appear in any picker that consumes the registry. See docs/icons.md for the full guide.
Removing icons
Remove icons from the registry — a single icon, or an entire namespace such as the core/* icons that ship with WordPress — either hard-removed or hidden from picker UIs via REST. See docs/icons.md for the full guide.
Installation
Manual Installation
- Download the latest release ZIP from the Releases page.
- Go to Plugins > Add New > Upload Plugin in your WordPress admin area.
- Upload the ZIP file and click Install Now.
- Activate the plugin.
Install with Composer
To include this plugin as a dependency in your Composer-managed WordPress project:
- Add the plugin to your project using the following command:
composer require s3rgiosan/icons-extended
- Run
composer install. - Activate the plugin from your WordPress admin area or using WP-CLI.
Quick start
- Register an icon on
initpriority 1–4 vias3s_register_icon( 'my-plugin/star', [ 'label' => 'Star', 'content' => '<svg…/>' ] ). - In a post or page, insert a
core/iconblock and pick your icon from the picker. - Optionally remove WordPress's built-in icons with
s3s_unregister_icons_namespace( 'core' )oninitpriority 6.
Requirements
- WordPress 7.0 or higher
- PHP 8.2 or higher
Tests
PHP tests run inside a wp-env container:
npm run test:setup # first time only — starts Docker WP + test DB
npm run test:unit
Changelog
All notable changes to this project are documented in CHANGELOG.md.
License
This project is licensed under the GPL-3.0-or-later.
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2026-05-23