s3rgiosan / icons-extended
Package info
github.com/s3rgiosan/icons-extended
Type:wordpress-plugin
pkg:composer/s3rgiosan/icons-extended
Requires
- php: ^8.2
- yahnis-elsts/plugin-update-checker: ^5.5
Requires (Dev)
- phpunit/phpunit: ^9.6
- pixelalbatross/coding-standards: dev-main
- yoast/phpunit-polyfills: ^1.1
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.