-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API for registering custom icons for the editor #51563
Comments
Related #16513 |
@scruffian Is there any scope here to absorb icons as part of global styles as some kind of element? Is that even possible? |
I think it makes more sense for it to be a block? |
I agree that having a block for "icon" might be useful. However, this issue is specifically about providing a means for developers to use custom icons within the editor. What we need is a means to register those icons (note: that doesn't mean we need to be able to upload them). One use case for such an API can be found here. |
It's possible to create an icon element, but I don't think it would help much with what you're seeking to achieve here. It could be a good followup though. |
I think we should consider doing this via Theme JSON instead. I'm going to think about this some more and come up with a counter proposal. |
There have been quite a few requests to allow us to customise the icons used in blocks in the editor
Currently this is not possible.
Whilst exploring this in #51527 I suggested exploring a new API to allow developers to register their own custom icons with the editor.
As I suggested we would need to register this PHP side and sanitize the SVG there.
Then on output we would:
esc_
functions.dangerouslySetInnerHTML
with equivalent escape functions.The text was updated successfully, but these errors were encountered: