You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9be14bd
Browse filesBrowse the repository at this point in the historyBrowse files
authored
Icons: Allow icons to ship to WordPress Core without exposing them in the Icon block (#82634)
Copy file name to clipboardExpand all lines: packages/icons/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@
9
9
### Enhancements
10
10
11
11
- Redraw a further 141 icons as stroke-based for variable stroke-width support, following the convention introduced in [#78808](https://github.com/WordPress/gutenberg/pull/78808), and refine the already stroke-based `image` drawing. Most retain their original footprint; the table icons, `capturePhoto` and `image` are slightly smaller by design. ([#82540](https://github.com/WordPress/gutenberg/pull/82540))
12
+
-`manifest.json`: The `public` property is now a tri-state. Omitting it keeps an icon in the JS library only; `true` ships it to WordPress Core and exposes it through the icons REST API, making it selectable in the Icon block; `false` ships it and registers it in the `core` collection for server-side use via `wp_get_icon()`, while hiding it from the REST API and the Icon block. ([#82634](https://github.com/WordPress/gutenberg/pull/82634))
13
+
- The `wordpress` icon now ships to WordPress Core as a non-public icon: it is registered in the `core` collection and stays available to server-side code via `wp_get_icon( 'core/wordpress' )`, but is not exposed through the icons REST API and is not selectable in the Icon block. ([#82634](https://github.com/WordPress/gutenberg/pull/82634))
Copy file name to clipboardExpand all lines: packages/icons/README.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,10 @@ To add a new icon to the library, follow these steps:
50
50
-`slug`: The icon identifier (should match the SVG filename without the `.svg` extension)
51
51
-`label`: The human-readable label for the icon. Use Title Case (for example, `My New Icon`).
52
52
-`filePath`: The relative path to the SVG file (e.g., `library/my-new-icon.svg`)
53
-
-`public` (optional): Set to `true` if you want to expose this icon as a core icon through the SVG Icons API. **Important**: Once an icon is made public, removing it is difficult, so carefully consider whether to make it public before setting this field to `true`.
53
+
-`public` (optional): Controls whether the icon is shipped to WordPress core, and if so how far it is exposed. **Important**: Once an icon ships, removing it is difficult, so carefully consider this field before setting it.
54
+
- Omit the field to keep the icon in the JS library only. It is not shipped to core.
55
+
-`true` ships the icon to core and exposes it through the SVG Icons API, which makes it selectable in the Icon block.
56
+
-`false` ships the icon to core and registers it for server-side use through `wp_get_icon()`, but hides it from the REST API and the Icon block. Use this for icons that belong to the admin UI rather than to post content, such as admin menu icons.
54
57
4.**Do not edit `manifest.php`**: The `manifest.php` file is automatically generated from `manifest.json` by the build script. Do not edit it manually, as your changes will be overwritten when the build runs.
55
58
56
59
After adding your icon, run `npm run build` to generate the TypeScript files and update `manifest.php`.
0 commit comments