RuntimeActive

WordPress Playground

WordPress Playground: WordPress Developer Resources | Developer.WordPress.org Showcase Plugins Themes Hosting News Resources Learn WordPress Documentation Education Forums Developers Blocks Patterns Photos Openverse ↗ ︎ WordPress.tv ↗ ︎ About About WordPress Make WordPress Events Five for the Future Enterprise Gutenberg ↗ ︎ Job Board ↗ ︎ Swag ↗ ︎ Get WordPress Search in WordPress.org Get WordPress WordPress Developer Resources Developer Blog Code Reference WP-CLI Commands Developer Blog Code Ref

Open source page

Field note

What it does

Hands-on with the WordPress 7.1 Icon Registration API By Justin Tadlock August 18, 2026 Common APIs , Plugins , Themes When WordPress 7.0 launched the Icon block earlier this year, it was one of the most exciting moments I’d felt in a while. But it was also a bit of a letdown because there was no public API for registering custom icons. The list of available icons for the block felt limiting for most creative uses of it. The good news: the public API is shipping with WordPress 7.1! And it does nearly everything that I need for truly using it in projects, such as this restaurant menu idea I’ve been tinkering with: In this tutorial, I’ll walk you through some of the basics. Then you’ll learn how to build a complete icon registration plugin from start to finish. Table of Contents How to register icons A quick overview of the registration functions An example collection and icon Building an icon registration plugin Plugin setup Bundling icons in plugin Defining the icon data structure Registering the icons with WordPress Load the plugin files and bootstrap Outputting icons The missing pieces: what you can’t yet do Allowlist of elements Stroke attribute is stripped No editor component…yet How to register icons This tutorial covers the introductory layer of using the API, the relevant parts for most use cases. For a complete overview, read the Registering and rendering SVG icons in WordPress 7.1 developer note.

Capabilities

Available capabilities

Tags

Tags

No tags filed yet.

Ways to use it

Ways to use it

No integrations filed yet.

Product features

Product features

A quick overview of the registration functions

An example collection and icon

Building an icon registration plugin

Bundling icons in plugin

Defining the icon data structure

Hands-on with the WordPress 7.1 Icon Registration API

How to register icons

Load the plugin files and bootstrap

Outputting icons

Plugin setup

Registering the icons with WordPress

The missing pieces: what you can’t yet do