We have stabilized three core features and shipped them in 7.0 Beta1:
WP_Icons_Registry class: The singleton class that loads core SVG icons from a manifest file, stores them, and exposes methods to check registration and retrieve icon data and content. There is currently no way to register a custom icon.
WP_REST_Icons_Controller: The REST API controller that exposes the icon registry over wp/v2/icons, letting the editor list icons and fetch a single icon by name.
- Icon block (
core/icon): The core block that retrieves a list of icons from the endpoint and lists them in a modal. The selected icon name is saved as an attribute, and the content is rendered server-side via the icon registry.
To make the Icon API more robust and extensible, I believe the following features are necessary:
Code quality
✅ Icon registry enhancements
✅ REST API enhancements
✅ Collection Support
Similar to Font Library, it should be possible to support collection: consumers will want to group icon sets based on their own brand.
Create Icon Picker Modal component
Icon block enhancements
For example, the early prototype of the Icon Block had the following features, which we can consider as enhancements:
Customizable icon support for other blocks
Some icons render their own hard-coded SVG content or symbols. Make those icons selectable via the Icon API.
Inline SVG icon (Inline format)
We have stabilized three core features and shipped them in 7.0 Beta1:
WP_Icons_Registryclass: The singleton class that loads core SVG icons from a manifest file, stores them, and exposes methods to check registration and retrieve icon data and content. There is currently no way to register a custom icon.WP_REST_Icons_Controller: The REST API controller that exposes the icon registry overwp/v2/icons, letting the editor list icons and fetch a single icon by name.core/icon): The core block that retrieves a list of icons from the endpoint and lists them in a modal. The selected icon name is saved as an attribute, and the content is rendered server-side via the icon registry.To make the Icon API more robust and extensible, I believe the following features are necessary:
Code quality
file_pathkey in icon registry #79100sanitize_svg()instead.Icons Registry: improve SVG sanitizer #75550
✅ Icon registry enhancements
core/. If we allow custom icon registration in the future, we will need to strictly check that the icon name follows the{namespace/icon-name}format.Icons: Enforce strict name validation in
registermethod #76079✅ REST API enhancements
searchparameter, but only thenamefield is referenced. We could also reference thelabelfield and an optionalkeywordsfield. Icons API: Support searching in labels; extend classes post-7.0 work #75878register_icon()functionunregister_icon()functioncore-iconstheme support: This is similar to thecore-block-patternstheme support: if this support is disabled, all core icons will not be registered.✅ Collection Support
Similar to Font Library, it should be possible to support collection: consumers will want to group icon sets based on their own brand.
WP_Icon_Colloections_RegistryWP_REST_Icons_Colloections_Controllerwp_register_icon_collection()functionwp_unregister_icon_collection()function_wp_register_default_icon_collectionsfunctionCreate Icon Picker Modal component
DataViewPicker. (ref) Perhaps it should be possible to add a component likeIconPickerModalto the@wordpress/block-editorpackage and load it from a block. This icon picker should be useful for blocks other than the Icon block as well.DataViewsPickerbased UIIconPickerModalinto block-editor for reusability #76787Icon block enhancements
For example, the early prototype of the Icon Block had the following features, which we can consider as enhancements:
Icon Block: Add flip and rotate transformation controls #77017
Add link support to the Icon block #79057
Customizable icon support for other blocks
Some icons render their own hard-coded SVG content or symbols. Make those icons selectable via the Icon API.
+symbol)Inline SVG icon (Inline format)