[wp-trac] [WordPress Trac] #35775: Enhancements: add_post_thumbnail_image_size / wp_get_attachment_id

WordPress Trac noreply at wordpress.org
Mon Feb 22 20:29:44 UTC 2016


#35775: Enhancements: add_post_thumbnail_image_size / wp_get_attachment_id
--------------------------------+------------------------------
 Reporter:  torben.tschechne@…  |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Media               |     Version:
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:
--------------------------------+------------------------------
Changes (by swissspidy):

 * focuses:  accessibility, performance =>
 * version:  4.4.1 =>


Comment:

 > I do not need a 200px wide image of 20 images which are used in the post
 - I only need it for the post-thumbnail. From that perspective I would
 like to have another function than add_image_size - for example:
 add_post_thumbnail_image_size which is only triggered when somebody
 selected an image as the post-thumbnail. This will save space on the
 servers as well.

 See #13372 (kind of) and
 http://wordpress.stackexchange.com/questions/108572/set-post-thumbnail-
 size-vs-add-image-size/ for a workaround.

 > Sometimes I have the case that I need the attachment ID of an url that
 has been uploaded. For example: I delevoped a plugin where an image can be
 chosen, the input field is a text field for a URL. In that case I need to
 determine the attachment ID to have access to all the necessary WP
 functions.

 See `attachment_url_to_postid()` and #16830

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


More information about the wp-trac mailing list