Repository navigation
Conversation
…al Settings. When an image that already has the required site icon dimensions (512x512) is selected in Settings > General, the crop step is skipped and the original image is saved as the site icon, so the site icon sizes (32, 64, 180, 192 and 270) are never generated. Send the image through the crop-image request with the `site-icon` context, as the Customizer already does, so the site icon and its sizes are created. See #66309.
|
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 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. |
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. |
In Settings > General, when the selected Site Icon image is already exactly 512×512, the crop step is skipped and the original image is saved as the site icon. The site icon sizes (32, 64, 180, 192 and 270) are only created by the
crop-imagerequest with thesite-iconcontext, so they are never generated. Favicons and app icons then fall back to the regularthumbnail(150px) andmedium(300px) sizes.The Customizer's Site Icon control handles the same case by still sending a full-size "crop" request (
wp.customize.SiteIconControl.onSelect()). This was lost when the control was brought to the General Settings screen in 6.5.This PR sends exact-size images through the same
crop-imagerequest with thesite-iconcontext, and reuses the existingcroppedhandler to update the field and previews. A failed request shows the media modal's crop error.Trac ticket: https://core.trac.wordpress.org/ticket/66309
Testing Instructions
cropped-…image is created for the site icon.wp eval 'print_r( array_keys( wp_get_attachment_metadata( get_option( "site_icon" ) )["sizes"] ) );': it now includessite_icon-32,site_icon-64,site_icon-180,site_icon-192andsite_icon-270.Before this change, step 5 only lists
thumbnailandmedium, andget_site_icon_url( 32 )returns the 150×150 image.Props ravipatel.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Investigating the cause, writing the fix and this description. I reproduced the issue, tested the fix locally, and take responsibility for it.
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.