[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 10:59:28 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        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In WP_Site_Icon::additional_sizes(), site icon subsize definitions use the
 array key `'width '` (with a trailing space) instead of `'width'`.

 File: wp-admin/includes/class-wp-site-icon.php
 Method: WP_Site_Icon::additional_sizes()

 The image editor reads $size_data['width']. Because the key is wrong,
 width is null and subsizes are not generated as intended square crops.

 Steps to reproduce:
 1. Set site_icon to a non-square attachment without going through the
 Customizer crop UI (e.g. assign an existing landscape photo).
 2. Regenerate or create site_icon-* subsizes.
 3. Inspect attachment metadata sizes site_icon-192, site_icon-32, etc.

 Expected: 192x192, 32x32 square crops.
 Actual: non-square dimensions (e.g. 256x192, 43x32).

 Impact: get_site_icon_url() may fall back to the full scaled image for
 head meta tags.

 Fix: change `'width '` to `'width'` on the site_icon subsize definition
 line.

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


More information about the wp-trac mailing list