Opened 11 years ago
Closed 3 years ago
#34383 closed feature request (wontfix)
Feature Request - Add ID field and function to dynamically generate image IDs for images in the Media Library
| Reported by: | mudboxmedia | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Media | Version: | 4.3.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | ui, administration |
Description
I have a feature request for WordPress core. I'd like to see an HTML ID field in addition to the fields for URL, Title, Caption, Alt Text, and Description in the Media Library. Having this field for input and a function to dynamically output the id attribute as part of core would allow developers to rapidly style specific images without having to re-code themes.
Change History (2)
#2
@
3 years ago
- Resolution → wontfix
- Status new → closed
Given @swissspidy's comments, which I agree with, and the 8 years that have passed since this request, I'm closing this as wontfix. I'll also note that the potential for a re-use of an ID attribute can cause accessibility issues, so it's definitely something to avoid.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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, where755is 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.