[wp-trac] [WordPress Trac] #47364: Docs: Standardise the description for image size parameters

WordPress Trac noreply at wordpress.org
Sun Mar 1 15:48:27 UTC 2020


#47364: Docs: Standardise the description for image size parameters
-------------------------+-----------------------------
 Reporter:  johnbillion  |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Media        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  docs
-------------------------+-----------------------------

Comment (by SergeyBiryukov):

 Crossposting a comment by @marekdedic from comment:71:ticket:48303:
 > Hi, I started by looking at the function `get_the_post_thumbnail` and
 its parameter `$size`, which is currently of the type `string|array`. I
 think this could be narrowed down to `string|int[]` by examining its
 source and all the functions and hooks it calls. As such, I think these
 functions and hooks could have their parameter `$size` narrowed in the
 same way. The ones I encountered:
 >
 > Functions:
 > - `get_the_post_thumbnail`
 > - `wp_get_attachment_image`
 > - `wp_get_attachment_image_src`
 > - `image_downsize`
 > - `image_get_intermediate_size`
 > - `image_constrain_size_for_editor`
 >
 > Hooks:
 > - `begin_fetch_post_thumbnail_html`
 > - `end_fetch_post_thumbnail_html`
 > - `wp_get_attachment_image_src`
 > - `image_downsize`
 > - `image_get_intermediate_size`
 > - `editor_max_image_size`
 >
 > However, I'm pretty sure there are more.

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


More information about the wp-trac mailing list