[wp-trac] [WordPress Trac] #65345: Site Icon subsizes use wrong array key 'width ' instead of 'width'

WordPress Trac noreply at wordpress.org
Tue May 26 11:07:25 UTC 2026


#65345: Site Icon subsizes use wrong array key 'width ' instead of 'width'
-------------------------------------+------------------------------
 Reporter:  tomatillo                |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Media                    |     Version:  7.0
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+------------------------------
Changes (by tomatillo):

 * keywords:   => has-patch needs-testing


Comment:

 Patch attached.

 Fixes a trailing space in the site icon subsize definition array key
 (`'width '` → `'width'`).
 Without this, WP_Image_Editor receives a null width and generates non-
 square site_icon-* crops,
 which can cause get_site_icon_url() to fall back to the full scaled image.

 Test plan:
 1. Apply patch to trunk.
 2. Assign a non-square attachment as site_icon without the Customizer crop
 UI.
 3. Regenerate site_icon-* subsizes.
 4. Confirm site_icon-32, site_icon-180, site_icon-192, and site_icon-270
 are square.
 5. Confirm get_site_icon_url(192) returns the cropped file, not the full
 image.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/65345#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list