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

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 9 21:38:17 UTC 2012


#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 Sam_a):

 Hi wpsmith,

 Under WordPress's current behavior, the `width` and `height` attributes
 don't go through the `wp_get_attachment_image_attributes` filter, so a
 plugin that builds its own $attr array and returns it without `width` and
 `height` doesn't actually intend to remove them (as nacin noted in
 [http://core.trac.wordpress.org/ticket/14110#comment:5 #5]).

 So if we also expose `width` and `height` in the filter, we want to
 continue that behavior — if the `width` and `height` keys are missing
 after applying the filter, restore them to their original values, as if
 they hadn't been removed.

 Plugins that really want to empty `width` and `height` can set them to
 `''` or `false` through the filter to get that.

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


More information about the wp-trac mailing list