[wp-trac] [WordPress Trac] #34383: Feature Request - Add ID field and function to dynamically generate image IDs for images in the Media Library

WordPress Trac noreply at wordpress.org
Wed Oct 21 15:05:39 UTC 2015


#34383: Feature Request - Add ID field and function to dynamically generate image
IDs for images in the Media Library
-----------------------------+---------------------------------
 Reporter:  mudboxmedia      |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Media            |     Version:  4.3.1
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  ui, administration
-----------------------------+---------------------------------

Comment (by swissspidy):

 Hi there! Welcome to trac and thanks for your report.

 When you insert an image from the media library into a post, it already
 has a class like `wp-image-755`, where `755` is the attachment ID.

 I wouldn't encourage you to use HTML ID attributes. You cannot guarantee
 that the image will exist only once on a page. That's why you should
 target classes whenever possible.

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


More information about the wp-trac mailing list