This plugin works in conjunction with The Icon Block and my fork of Enable Button Icons. Nearly every big project with a custom theme requires some custom icons and this provides a straightforward workflow for building them into your project.
- Install this plugin along with The Icon Block and (optionally) my fork of Enable Button Icons.
- Put SVG icon files in the
/wp-content/plugins/project-icons/project-icons/
directory. - Ensure the icons have hyphenated file names. For example, "paper-plane.svg" will have the slug "paper-plane" and the label "Paper Plane"
- Optionally create directories inside
/wp-content/plugins/project-icons/project-icons
/ and put your icons inside them. For example,wp-content/plugins/project-icons/project-icons/category-one/paper-plane.svg
. The paper plane icon will now be part of "Category One." - If an icon should be a member of two (or more) categories, just put a copy inside each category directory.
- In your terminal, navigate to this plugins directory and install its dependecies with
npm install
- Compile your icons with
npm run build
- Activate the plugin and you'll find your icons in the "Icon Library" when using the Icon Block or the core/button block.
As the project evolves over time simply add more icons to the directory and re-run npm run build