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

WordPress Trac noreply at wordpress.org
Mon Feb 4 19:51:35 UTC 2013


#14110: Expose height and width attributes to 'wp_get_attachment_image_attributes'
filter
-----------------------------------+-----------------------------
 Reporter:  divinenephron          |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Future Release
Component:  Media                  |     Version:  3.0
 Severity:  minor                  |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+-----------------------------

Comment (by anatolbroder):

 Maybe you should combine the functions
 ''[http://core.trac.wordpress.org/browser/tags/3.5.1/wp-
 includes/media.php#L544 get_attachment_image]'' and
 ''[http://core.trac.wordpress.org/browser/tags/3.5.1/wp-
 includes/media.php#L228 get_image_tag]''. They try to do similar things,
 but are both not flexible enough for using in plugins.

 We need one low level function ''lowlevel_image'' for just creating an
 image tag from an attribute array.

 {{{
 <img
     alt='Image'
     class='image'
     data-image='{JSON}'
     height='456'
     id='123'
     src='image.png'
     title='Image'
     width='789'
     …
 />
 }}}

 And we need a high level function ''highlevel_image'' for own attachment
 images. The ''highlevel_image'' should collect the attributes from image
 meta an pass them to the ''lowlevel_image''.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14110#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list