Repository navigation
Conversation
|
Hi there! 👋 Thank you for your contribution to WordPress! 💖 It looks like this is your first pull request to No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making. More information about how GitHub pull requests can be used to contribute to WordPress can be found in the Core Handbook. Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook. If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook. The Developer Hub also documents the various coding standards that are followed:
Thank you, |
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. |
ec0faf9 to
6ec651a
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @lucasmendes-design. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
cc-ing (maybe) interested parties :) @t-hamano @jasmussen @tyxla @scruffian @lucasmendes-design |
|
These all appear to be solid like-for-like replacements, though I feel least supportive of the |
|
@jeffpaul Thanks for checking!
Yep, as noted in the PR description, I'm not sure about this as well.
You mean
But my worry is that the icon slug is not related to "site" at all. I would expect there is something like Another idea is to use this icon, to represent a "site switcher":
|
|
A few things from my end as I'm looking at this work:
|
|
@fushar yes the |
Thanks for the suggestion. I spent a good chunk of my day today trying to make this as a Gutenberg experiment. With the help of Claude, I (we) came up with this PR: WordPress/gutenberg#79588. Now, I understand that the changes are complicated, but I can't simplify it any further. Reasons:
Am I approaching this correctly? Or do you have better idea for a cleaner approach? Thanks! cc: @mcsf |
Hmm, this seems correct to me. There are side ways for achieving some of the things you mentioned, but not for others, unless we want to be super hacky. A bummer that this part of the menu is not as extensible as usual. Thank you for trying, though. Another way to get more attention on this would be to post a call for testing on the https://make.wordpress.org/core blog. |
I'd say so, at least for the purposes of a Gutenberg experiment. I left a comment or two in that PR. |
@jeffpaul: I agree that it looks better than a 2x2 grid. For the purpose of demonstration, I updated this PR to use that for the time being: |
|
@fcoveram: Thanks for the thorough testing!
Yeah, it is intentional. I'm not sure if it's the best way though. It's to achieve the same look and feel with the existing W dashicon. See the above image comparison, pasted here again:
Right now, if we use 22px, then the W logo is too small, because there's outer gap in the SVG. Maybe we need to fill the entire SVG box without any outer gap.
Yeah agree that 0.85 looks better. But I'm not sure if we can just update it only for the SVG icon. It's part of the Fresh color scheme; maybe we should do a separate PR to update the scheme 😄 |
|
All right everyone, thanks for taking a look. I want to summarize where we're at with this PR:
It feels like there's interest to push at least some parts of it in 7.1, and we're not that sure if we can achieve everything by 7.1. @t-hamano, what's your opinion on this? It seems you have the most context for all this icon API discussion 😄 cc: @tyxla, @mcsf, @scruffian. |
Leveraging the icon API for the dashboard icons is a great idea, and introducing a add_action( 'init', function () {
wp_unregister_icon_collection( 'core' );
}, 20 );add_action( 'init', function () {
wp_unregister_icon( 'core/info' );
}, 20 );In this case, what happens to the core menu icons registered by the icon API? This is my biggest concern. Here are the ideas I can come up with at the moment:
Do you have any other ideas? |
|
Thanks for taking a look.
Hmm interesting question. I would say, the last option (consider Otherwise, we will also need another way to get the SVG string for the admin bar icons as well, because in this PR I also use |
|
Thanks for the additional context 😄 the search icon direction is now fixed in the latest commit 6c3fc8b. |
|
The icon direction looks correct now ✨ |
peterwilsoncc
left a comment
There was a problem hiding this comment.
I've done a first pass and added a few notes inline.
| * menu items. Those Dashicons are only mapped to their replacement icons here, when | ||
| * the menu is rendered. | ||
| */ | ||
| $dashicon_replacements = array( |
There was a problem hiding this comment.
I think this could do with quite a few more mappings from the old dashicon class names.
For example the Shortnotes plugin uses dashicons-edit which looks to map to core/pencil, similar for CPTs using other icons, eg dashicons-cart to core/cart, etc.
Using shotnotes as an example the old dashicon looks out of place even though there's a modern equivalent available
|
@peterwilsoncc Let's discuss your comment here instead of on the diff. GitHub UI is bad for PRs with many comments; it's hard to follow chronological discussion 😅 Reading the comment, I think there's a bit a more fundamental issue here. If plugins want to "migrate" their dashicons to SVG icons, should we tell them to use
I'm thinking a few approaches here:
Sorry, I just realized about this now. I might be overthinking, but the potential confusion is real here. |
@fushar Thanks for raising this. I agree that your concern is valid. Here are my thoughts and suggestions:
I tried installing a lot of plugins, and personally, I don't find the mix of SVG icons and Dashicons that jarring. What do you think? |
|
Thanks @t-hamano I agree with all your suggestions. They all make sense to me. Particularly:
Yep, I agree. I know that @jasmussen et al have designed the icons in such a way that they don't look too out of place compared to the original Dashicons 🙂
I'll add that to the dev note.
Yeah, agree. I think we should add more generic icons, like |
|
I agree with @t-hamano's plan, including not auto-mapping third-party dashicons, with a few small notes:
|
Honestly, I don't fully understand this and this is a bit beyond my expertise 😄 I'd like to defer the implementation details to the icon designers @jasmussen / @lucasmendes-design. We should be able to follow up as separate PR during the Beta if needed. |
|
Folks, thanks for all the help and feedback for this PR so far. Really appreciate it. As Beta 1 is around the corner, I think we should wrap up this PR soon if we want to include it in 7.2. Based on what I read so far, there's no major blocker. What's left is to have an agreement on the proposed back-compat strategy in the dev note, and test its claims. Personally, I've already tested this PR so many times with various plugins / color schemes 🙂 |
|
Hey folks, sorry I'd missed the resolutions of the previous comments -- as @fushar said, the GH UI can sometimes be confusing.
Agreed: this can go in beta 1 and further substitutions discussed and an approach figured out during the beta period. I do like the idea of including the converted icons in the core group within the core-admin group. The font's name dashicons does imply they are available in the dashboard so it's not an unreasonable assumption that the converted icons will be available in the dash. It would be good to get the dev note out very shortly after beta 1 so devs in plugin land can provide feedback asap. |
t-hamano
left a comment
There was a problem hiding this comment.
@fushar Thanks for your continued work on this. I won't have much time for work for about a week starting tomorrow, so this will probably be my final feedback, but I'm approving this PR as well.
There are two things I'd like to note, both of which can probably be explored in follow-ups:
- Unregistering
core-adminicons: The current implementation only calls_doing_it_wrong()when an icon is not registered at render time. However,wp_deregister_script()already guards against deregistering core scripts in the admin. With that in mind, I think it might be fine to also block unregistering thecore-admincollection and its icons, with a_doing_it_wrong()notice. - Page load performance: As discussed in this thread, there is a slight increase in server response time. I believe it can be addressed with some of the approaches proposed there.
Yep, I think they can be followed up later and don't need to block this PR 😄 Thanks for all your reviews! |
|
Catching up, please let me know if I missed anything, it was Danish potato vacation last week.
I agree, and yes please open issues, happy to draw. To note, though, envelope and cart both exist, same names.
That's from this comment, and I can unpack it: the new icons have flexibility the old ones didn't: we can tweak the stroke-width. There's an ongoing question around whether we should, and even how we tweak it if we do. All of that, honestly I'm increasingly leaning towards the instincts of Fran, Aki, @jameskoster and @ciampo on the precise details. What we do, if anything, in this iteration, I think should not overall affect what we do with this branch: one of the benefits of unifying on WordPress icons (which is the overwhelming focus of this branch), is to unify the codebase too, so whatever improvements we make to the core set, including any changes to stroke-scaling behavior for better legibility, will benefit the admin in future iterations too. So I don't know that we should do any local changes here in this branch or not, I lean to whatever is the simplest to let us focus on the shipping. Is that helpful? |
# Conflicts: # src/js/_enqueues/admin/user-profile.js
|
Catching up as well. I agree with @jasmussen. No icon-specific changes in this branch. Both open design points are library questions, and Core gets the answer when it bumps |
…ons. Replace the usage of Dashicons in admin bar and sidebar with `@wordpress/icons` via the newly-introduced `wp_get_icon()` function, which outputs an inline SVG to be rendered. Developed in #12270. Props fushar, wildworks, tyxla, mcsf, mciampini, aduth, peterwilsoncc, jeffpaul, fcoveram, keoshi, joen, afercia, ugyensupport, mrwweb. Fixes #65089. git-svn-id: https://develop.svn.wordpress.org/trunk@64583 602fd350-edb4-49c9-b593-d223f7449a82
…ons. Replace the usage of Dashicons in admin bar and sidebar with `@wordpress/icons` via the newly-introduced `wp_get_icon()` function, which outputs an inline SVG to be rendered. Developed in WordPress/wordpress-develop#12270. Props fushar, wildworks, tyxla, mcsf, mciampini, aduth, peterwilsoncc, jeffpaul, fcoveram, keoshi, joen, afercia, ugyensupport, mrwweb. Fixes #65089. Built from https://develop.svn.wordpress.org/trunk@64583 git-svn-id: http://core.svn.wordpress.org/trunk@63733 1a063a9b-81f0-0310-95a4-ce76da25c4cd







Trac ticket: https://core.trac.wordpress.org/ticket/65089
This PR replaces the dashicons usage in admin bar and menu (sidebar) with
@wordpress/icons, via the newly-introducedwp_get_icon()function, which outputs an inline SVG to be rendered.New icon mapping
Admin bar
dashicons-wordpresscore-admin/wordpressdashicons-menu-altcore-admin/menudashicons-admin-multisitecore-admin/sitesdashicons-dashboardcore-admin/dashboarddashicons-admin-homecore-admin/homeCustomize
dashicons-admin-appearancedashicons-admin-customizercore-admin/brushdashicons-editcore-admin/pencildashicons-pluscore-admin/plusdashicons-admin-commentscore-admin/commentdashicons-updatecore-admin/updateCommand Palette
dashicons-searchcore-admin/searchdashicons-admin-userscore-admin/peopleAdmin menu (left sidebar)
For simplicity, only showing new items not present in the admin bar above.
dashicons-admin-postcore-admin/pindashicons-admin-mediacore-admin/mediadashicons-admin-linkscore-admin/linkdashicons-admin-pagecore-admin/pagedashicons-admin-pluginscore-admin/pluginsdashicons-admin-toolscore-admin/tooldashicons-admin-settingscore-admin/settingsdashicons-admin-collapsecore-admin/chevron-leftOpen questions
I'm not sure aboutMy Sitesicon. The closest thing that I think fits is thecore/gridicon (see screenshot below). Open to alternatives.Updated toUpdated tocore/block-metafor the time being, still open to alternatives.core/sitesfrom Icons: Add "sites" icon. gutenberg#80094.Screenshots
WP Admin
WP Admin - Multisite
Frontend
Before
After
Mobile
Before
After
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.8
Used for: code generation, with my supervision.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.