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

WordPress Trac noreply at wordpress.org
Mon Feb 8 14:14:10 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:  4.4.1
 Severity:  normal                      |   Keywords:
  Focuses:  accessibility, performance  |
----------------------------------------+-----------------------------
 Hello,
 I hope I am in the right place here to suggest two enhancements for WP
 core.

 1:
 From my perspective the most used image of a post is the post-thumbnail. I
 use this post thumbnail quite often in different sizes - for teasers,
 related posts, sliders etc. From a performance perspective I always want
 to deliver the image in the correct dimensions. No 1600px image in a
 related post section where the image is 200px wide etc. I am struggling a
 bit because I often work on websites which have a lot of pictures in their
 posts. When I add a new image size its always relevant for all images
 which are uploaded to WP and often they are not necessary. 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.

 2:
 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. In this case I built my own function that does it, but I think
 it will also be a function that can be helpful if it is integrated in WP.

 Looking forward to your reply.

 In order to always get the image in the correct dimensions which are

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


More information about the wp-trac mailing list