[wp-trac] [WordPress Trac] #14110: Expose height and width attributes to 'wp_get_attachment_image_attributes' filter

WordPress Trac noreply at wordpress.org
Thu Jun 28 13:20:51 UTC 2018


#14110: Expose height and width attributes to 'wp_get_attachment_image_attributes'
filter
-------------------------------+----------------------
 Reporter:  divinenephron      |       Owner:  (none)
     Type:  enhancement        |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Media              |     Version:  3.0
 Severity:  minor              |  Resolution:  wontfix
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+----------------------

Comment (by puggan):

 Replying to [comment:22 SergeyBiryukov]:
 > Replying to [comment:21 puggan]:
 > > +1 ReOpen?
 >
 > Would be good to have answers to comment:15.

 If you define a max-width, and don't have the height-attribute, it keeps
 the ratio.
 If you define a max-width, and have a height-attribute, it keeps the
 height.

 [[Image(https://www.dropbox.com/s/xk8uz0jbdkgwl32/Screen%20Shot%202018-06-28%20at%2015.17.30.png?dl=0)]]

 {{{

 <style> img { max-width: 100%; } </style>
 <div style="width: 150px">
 <p>
 Image with attributes
 </p>
 <img
 src="https://www.google.se/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"
 height="92" width="272" />

 <p>
 Image without attributes
 </p>
 <img
 src="https://www.google.se/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"
 />
 </div>
 }}}

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


More information about the wp-trac mailing list