[wp-trac] [WordPress Trac] #35390: image_constrain_size_for_editor() should not affect images generated on the front end when `large` size is used.

WordPress Trac noreply at wordpress.org
Wed Apr 26 21:13:10 UTC 2017


#35390: image_constrain_size_for_editor() should not affect images generated on the
front end when `large` size is used.
------------------------------------------+-----------------------------
 Reporter:  rabmalin                      |       Owner:  joemcgill
     Type:  defect (bug)                  |      Status:  accepted
 Priority:  normal                        |   Milestone:  Future Release
Component:  Media                         |     Version:  4.4
 Severity:  normal                        |  Resolution:
 Keywords:  needs-unit-tests needs-patch  |     Focuses:
------------------------------------------+-----------------------------

Comment (by joemcgill):

 Was thinking about this again today and the simplest solution for the
 purposes of this ticket would be to add context awareness for `large`
 image sizes to `image_constrain_size_for_editor()` like we do for custom
 sizes.

 However, I'm wondering if we can look at the places where
 `image_downsize()` is used and move `image_constrain_size_for_editor()`
 out to the parent function when appropriate instead. So for example,
 `get_image_tag()` — which is only used in core to create image markup for
 the editor — would run the dimensions returned from `image_downsize()`
 through  `image_constrain_size_for_editor()`. That way, we can remove
 `image_constrain_size_for_editor()` from `image_downsize()` entirely.

 It would also be nice if `image_constrain_size_for_editor()` knew nothing
 about the context and just returned whatever the image size should be when
 constrained by `$content_width`.

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


More information about the wp-trac mailing list