[wp-trac] [WordPress Trac] #34257: Wrong order of width and height in image functions $size param descriptions

WordPress Trac noreply at wordpress.org
Mon Oct 12 10:37:07 UTC 2015


#34257: Wrong order of width and height in image functions $size param descriptions
----------------------------+-----------------------------
 Reporter:  jaspermdegroot  |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Media           |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 The image functions that accept an array with the image dimensions as
 argument for the {{{$size}}} parameter have a description of this
 parameter that says "a flat array of height and width values". This should
 be "width and height" since {{{$size[0]}}} has to be the width.

 Affected functions in 'wp-includes/media.php':
 - {{{image_constrain_size_for_editor}}} (change "array of sizes" to "flat
 array of width and height values")
 - {{{image_downsize}}}
 - {{{get_image_tag}}}
 - {{{image_get_intermediate_size}}}
 - {{{wp_get_attachment_image_src}}} (also in the filter description)
 - {{{wp_get_attachment_image}}}
 - {{{wp_get_attachment_image_url}}}
 - {{{gallery_shortcode}}}: (@type $size description doesn't mention that
 it also accepts an array)
 - {{{previous_image_link}}}
 - {{{next_image_link}}}
 - {{{adjacent_image_link}}}

 In 'wp-includes/post-template.php':
 - {{{wp_get_attachment_link}}} (change "@param string $size" to  "@param
 string|array $size" and "either array or string" to "either string or flat
 array of width and height values")

 The following functions in 'wp-includes/media.php' have a description of
 the {{{$crop}}} parameter with "specified height and width" in it.
 Although this isn't wrong, it might be better to change this to "width and
 height" as well to match the order of the parameters and for consistency.
 - {{{add_image_size}}}
 - {{{set_post_thumbnail_size}}}
 - {{{image_resize_dimensions}}} (also in the filter description)
 - {{{image_make_intermediate_size}}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34257>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list