[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
Tue Mar 8 20:07:24 UTC 2016


#36096: Custom Logo: Use of custom image size requires unexpected filtering of
image_size_names_choose
--------------------------+-----------------------
 Reporter:  westonruter   |       Owner:  obenland
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  4.5
Component:  Customize     |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------

Comment (by westonruter):

 I chatted with @obenland over Slack and suggested that we might as well
 drop the logic for applying the custom logo changes entirely with JS and
 instead rely on selective refresh to handle the preview. The problem with
 using JS to apply the preview is that it means we basically have to re-
 implement the entire `image_downsize()` logic from PHP in JS to determine
 which available image to use for the logo and to give it the proper
 dimensions. Even when this is done, there will be aspects we'll miss
 because WP allows the `image_downsize()` logic to be filtered. By using
 selective refresh, we'll be assured to get the canonical PHP-rendering of
 the logo.

 Since the only value of the JS instant preview is to show the image in
 place while waiting for the selective refresh request to respond, and
 since the response should come in less than a second, I don't think there
 is a lot of value to duplicate the logo display logic in JS and we can get
 rid of a lot of JS code.

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


More information about the wp-trac mailing list