The Icon Block plugin registers a single, easy-to-use block that allows you to add custom SVG icons and graphics to the WordPress block editor (Gutenberg). The plugin also includes the complete WordPress icon library with 290+ SVG icons.
The Icon Block includes several extensibility features that allow you to tailor the block to meet your needs.
iconBlock.icons
Filters all icons available in the built-in icon library. Use this filter to add or remove icons from the plugin. Learn more.
iconBlock.enableCustomIcons
Defaults to true
, this filter allows you to enable or disable custom SVG icon functionality. When disabled, you are restricted from using the icon library.
wp.hooks.addFilter(
'iconBlock.enableCustomIcons',
'example-theme/disable-custom-icons',
() => false
);
You can easily disable border and spacing settings in the Editor UI if your theme includes a theme.json file.
{
...
"settings": {
...
"blocks": {
"outermost/icon-block": {
"border": {
"color": false,
"radius": false,
"style": false,
"width": false
},
"spacing": {
"margin": false,
"padding": false
}
},
...
wp-content/plugins
folder.wp-content/plugins/icon-block
folder in the command line.npm install
to install the plugin's dependencies within a /node_modules/
folder.composer install
to install the additional WordPress composer tools within a /vendor/
folder.npm run start
to compile and watch source files for changes while developing.Refer to package.json
for additional commands.