Icons: Allow registering icons that are hidden from the REST API with public property - #13453
Draft
fushar wants to merge 1 commit into
Draft
Icons: Allow registering icons that are hidden from the REST API with public property#13453fushar wants to merge 1 commit into
public property#13453fushar wants to merge 1 commit into
Conversation
fushar
force-pushed
the
icons-public-false
branch
from
September 9, 2026 13:22
9618327 to
69d9e07
Compare
public property
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Icons can now be registered with `'public' => false`, which keeps them in the registry and reachable from server-side code via `wp_get_icon()`, while hiding them from the icons REST API and therefore from the editor's icon picker. This mirrors the tri-state `public` property in the Gutenberg icons manifest: - omitted: the icon stays in the JS library and is not shipped to core - `true`: shipped to core and exposed through the REST API - `false`: shipped to core and registered, but not exposed through the REST API `WP_Icons_Registry::register()` accepts and validates the new property, `_wp_register_default_icons()` forwards it when the core manifest carries it, and `WP_REST_Icons_Controller` omits non-public icons from `get_items()` and reports them as not found from `get_icon()`. Without this, a synced `icon-library-manifest.php` carrying `'public' => false` would fail to register the flagged icons at all, since the registry rejects a registration containing any unknown property.
fushar
force-pushed
the
icons-public-false
branch
from
September 9, 2026 14:10
69d9e07 to
c092f31
Compare
public propertypublic property
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport from WordPress/gutenberg#82634
What
This PR adds an optional boolean
publicproperty to icon registration. Icons registered withpublic: falsewill still be available throughwp_get_icon(), but the icons REST API hides them, so they aren't exposed in the Icon block.As a back-compatibility, if we don't provide a
publicproperty, the default istrueand the behavior will be the same as the existing behavior.Here's a summary of the behavior:
wp_get_icon()publicomitted ortrue'public: falseWhy
WIP
Changes
WIP
Testing instructions
WIP
@ticket TODOplaceholders that need to be replaced with the real number.