[wp-trac] [WordPress Trac] #36096: Custom Logo: Use of custom image size requires unexpected filtering of image_size_names_choose
WordPress Trac
noreply at wordpress.org
Fri Mar 4 23:17:31 UTC 2016
#36096: Custom Logo: Use of custom image size requires unexpected filtering of
image_size_names_choose
--------------------------+-------------------
Reporter: westonruter | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.5
Component: Customize | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-------------------
In testing the Custom Logo in Twenty Sixteen, I found a strange bug where
the the logo would appear momentarily in a large size and then get resized
down properly. The properly-sized logo would appear once the selective
refresh request returned. The momentarily-oversized image was the one
updated via the `postMessage` preview logic. See screencast:
https://youtu.be/JkQGhB_LzGo
I found that the media `get-attachment` Ajax request was not returning the
`twentysixteen-logo` among the available sizes. I was surprised to find
that in order to get a custom image size to be returned from the media
`get-attachment` Ajax queries, the image size had to be explicitly added
to the `image_size_names_choose` filter. This filter is probably
specifically for the UI to ensure that there are names for the sizes to
show, but this makes it a headache for themers to add support for Custom
Logos.
Here is what a theme currently has to do to add support using a custom
image size as a custom logo:
https://github.com/WordPress/twentysixteen/pull/434
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36096>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list