I haven’t actually tested this, but came across the following code on my travels. Might this help?
get_post_meta($attachment_id, '_wp_attachment_image_alt', true)
Related Posts:
- wp_delete_attachment doesn’t delete image files / doesn’t work
- How to Fix HTTP Error When Uploading Images?
- How can I bulk delete media and attachments using WP-CLI?
- Uploading Multiple Attachments From Front-End With A Description
- media_sideload_image file name?
- Get all posts (of any post type) an attachment is used in
- Password protect some uploaded files, so only logged-in users can view them
- Unattaching unlinked images
- WordPress media uploader – upload tabs not hiding
- problem in uploading attachment to custom directory
- Get images attached to a specific page
- Upload multiple image with media_handle_upload with multiple file field [duplicate]
- Can’t upload format files on media library
- Media Library Mess After FTP … /uploads
- Adding attachment custom field metadata to TinyMCE tag
- Organizing the Media Library for Cleanup
- controlling whether upload is attached to post or not
- How can I add a Description column to the media library browser screen?
- How to manage attachment relationships for specific posts in WP 3.5+
- Extend Media Library
- WordPress 3.5: Setting custom “full URL path to files” in the Media Library?
- How to trigger a refresh in the media modal
- How to show all available images in WP’s media library when using the Polylang plugin?
- Using Images in WordPress – Best Practices
- display image size in media library screen
- How to get all files inserted (but not attached) to a post
- How to protect uploads in multisite if user is not logged in?
- Append button to WordPress Image Details modal
- How to add media from front-end to an existing post?
- Get attachments (get_posts) and WP 3.5 new uploader
- exposing attachment uploading to the front end — delicate
- Automatically wrap post image in div
- Gel all image from certain post type
- How to Removing fields from the Media Uploader/Gallery on a Custom Post Type Edit Page
- Get the attachment URL on single.php
- How to disable WordPress Media resize different size version?
- Get attachments by user
- How to count media attachments?
- Get url from file uploaded in Media Library
- Add select field to media uploader that adds a class to the image
- How to add multiple checkbox elements to media attachments?
- How to host different file formats/types for a media attachment without creating multiple attachments?
- How to re-arrange media uploaded using : media_handle_upload() as per year / month
- How to stop unlink images when remove a site or user
- Perform a custom (bulk) action in media view
- Removing width and height attributes from wp-get-attachment
- Show attached media image if no thumbnail image detected
- How to fetch only media that was already attached to a post/page?
- Duplicate Custom Header Functionality into the post edit screen
- Post edit – Media Library – Only get images from current post
- Attach media to multiple posts
- Handling image uploads without thickbox
- How do I modify the “Insert Media” lightbox in the admin to only show media items from a category?
- I’m using add_meta_box() but want to include TinyMCE editor *and* Media Uploads for each box
- Display attachments by the ID of the post being edited in the wp.media frame (frontend)
- Uppload image from another source wp.media
- move_uploaded_file() not working on wordpress front end
- Media library quick/inline edit
- Email Attachment from Form Submit
- How to upload WordPress Images to remote web server and display those images in WordPress gallery [closed]
- What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
- How to get the return value of wp.media({ frame: ‘post’ }) in all cases?
- Massive photogallery import
- Images uploaded to the media library has strange colors. However, in the edit screen the color is ok
- What is the way to add additional fields to attachments in 3.5+?
- How to load attachment in media library for current user?
- how to get random media id from media gallery
- upload_max_filesize is set to 64 MB already but WordPress is still showing 2 MB
- Migrating media files (documents only) to a fresh install and maintaining the same directory structure
- WordPress media upload issue could not insert attachment into the database
- Thumbnail images missing in WP media library
- Remove Media File Items From Server That Do Not Exist in Media Library
- What if I have a large file on the server that I want the wp library to have?
- Get an image from the media library. Struggling with the code?
- Efficient way to move media folder to another folder
- Do custom post type (CPT) attachments/media store the parent post ID?
- Make inline uploader (plupload) on options page upload to a specific folder
- How can i set media attachments to the author of the post or page for already existed posts with attachments
- How to add HTML into error message
- unsharp thumbnails after uploading image
- How to manually set an attachment in a post?
- Media Library: Remove replace images of selected author
- What is wrong with my wp_insert_attachment code?
- Setting an image as post header (not featured image)
- How to upload multiple images using WP rest API to media?
- File was uploaded, but it is not shown on media section of the dashboard
- Using the GetMediaLibrary() method in python-wordpress-xmlrpc.media, how to iterate over the result?
- Organising and display thousands of photos in media library
- Check if author or uploader id of the attachment(uploaded) image is match?
- Custom Link In WordPress Media “Attachment Details” Upload Screen
- Is there a way to add Reattach and Unattach links in image gallery?
- wordpress 3.6 media manager cropping timestamp
- Broken Media Library
- Upload files in wordpress
- Edit Image/Image Details – Replace button missing
- Media Library is not loading on grid view in admin panel
- Blurry Images WordPress 5.8.1
- Save Custom Meta Value on Media Upload
- Media library upload hook
- upload image to wordpress media library failed for custom post type