Opened 5 years ago
Closed 5 years ago
#45776 closed enhancement (wontfix)
Getting current post’s featured image and its alt attribute
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Post Thumbnails | Keywords: | dev-feedback |
Focuses: | Cc: |
Description
There is have no function getting post thumbnail metadata. If we create a function it would be useful
https://wordpress.org/support/topic/getting-current-posts-featured-image-and-its-alt-attribute/
Change History (4)
Note: See
TracTickets for help on using
tickets.
get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
works just fine for this. Personally I don't see how an extra function for this is any more useful than this one liner. Especially if it's just for the featured image and not attachments in general.