The “full array” is constructed by Advanced Custom Fields from various sources. It’s not a format that occurs natively in WordPress.
If you want to output an image tag for an image with all the correct attributes, just use the ID with wp_get_attachment_image(). That returns an HTML <img> tag with the src, width, height, alt, srcset, sizes and class all populated. You can add or change attributes to the tag using the 4th argument:
echo wp_get_attachment_image(
$attachment_id,
'large',
false
[
'class' => 'custom-class',
'data-attribute' => 'custom-attribute-value',
]
);
To be honest, if your goal is to ultimately get an <img> tag, then even with ACF you should return an ID and use this function.
Related Posts:
- Programmatically adding images to media library
- Upload images to remote server
- How to delete resized (cropped) image uploads and prevent future resizing?
- Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords
- What’s the proper way to find and remove duplicate images from posts and the media library?
- Separate Media Library for each user
- Images dont show in grid view, but do in list view
- Remove duplicate images from media library.
- Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)
- Cannot access the thumbnails of attachment images… Cannot find the reason
- Why would image paths in wordpress suddenly change?
- Uploading images to Media Library fails with Memory Exhausted
- Why can’t I edit certain images from the WordPress Media library?
- Edit image preview is not displayed
- Uploading images: ‘ø’ get replaced with ‘ø’
- Regenerate missing _wp_attachment_metadata
- How to make programmatic image upload generate thumbnail and sizes?
- Best way to strip character entities (%20 etc)
- Random popup image per user with no repeat
- Different upload path per file type
- Display latest 12 images from media library
- Images are randomly deleted from server
- Bulk image rotation
- How to order images in a post in WordPress 3.3?
- ACF Image ID, echo the alt tag
- Check if the image exists in WordPress media library
- unattached media files that should be attached
- How to output images as figure/figcaption
- Bulk edit of EXIF data for jpeg images uploaded in the media library?
- In Wordress one author can not see the other’s author uploaded images through media library
- How to open default wp image editor screen dynamically?
- Is it possible to split Default WP Media directory to multiple Folder/Subdomain?
- Images uploaded to the media library has strange colors. However, in the edit screen the color is ok
- Alter image meta fields in the Media Library
- Add custom text in the media library image meta area
- Uploaded images not displaying in network site
- Unable to upload images to the Media Library. Getting this erron on the console wp-admin/async-upload.php 403 (Forbidden)
- Redirect to another page using contact form 7? [closed]
- What happened to the media manger?
- Can you check if a post WYSIWYG field has an image in it?
- How do I retrieve an image’s width and height using Advanced Custom Fields?
- Why does WP allow to view and media item as a page
- How to limit the number of images displayed in the media window?
- Images are not showing up in “Uploaded to this post”
- Create a post from every image in my media gallery
- Get images attached to a specific page
- Images don’t update after being edited
- URL through custom field returning null
- Is there a way in WordPress to convert images to WebP without a plugin?
- Change Image folder Locations
- Rebuild thumbnails via WP Cli – how?
- Some Images Disappeared from Media Library?
- are unattached media files a problem?
- WordPress Attachments with old images
- Large image not showing dimensions in Media Library
- Function to grab specific image IDs from media library.
- Fetching uploaded images using Link URL
- How can i sorting and display image order by siz in media library?
- WordPress append -1 to the image name
- Initializing the cropper for image uploads
- Custom Image Widget
- Media Library Cleanup A Thought Exercise
- Do I need to re-register all my images in the media library after a migration?
- Could creation of various image sizes cause slow form submission response?
- unsharp thumbnails after uploading image
- imported post image as normal image instead encoded image
- Post-processing of the image failed
- still need help-images inside wp-content/ uploads/ are not showing up in my media library and uploaded using FTP protocol
- The image keep redirect to my previous URL after I moving my site
- WordPress and Advanced Custom Fields and Flickity
- WordPress Link To Image Missing Dropdown
- After moving a site to new hosting, not all images are showing in media library
- Broken images in media library
- Images are not getting uploaded
- Unable to delete images in Media Library
- Edit image itself
- Change the image for a certain URL
- Assign one featured image to multiple posts?
- Some images don’t get linked when setting link-to to media-image
- Missing Images in Uploads Directory (Server Only)
- How do I embed an image at actual size?
- Image media upload problem in page editing modus?
- Broken Media Library
- Transfered live site to new server and images are not showing
- Limit files uploaded per folder
- My image rotate 90 degree
- How to get the attribues (alt and title) of an image import with ACF [closed]
- WordPress can’t get image url but both the attachment and the actual file are there
- Why some images are not allowed to be edited only for thumbnails?
- My subdirectory sites images (except webP) are throwing to 404 page even they are exist
- What does WordPress media uploader do to image files on upload?
- Media Library shows default image instead of image preview
- How can I use an image from an external source without uploading it to the media library
- Images have dissapeared from media library and site
- Generate / attach Image srcsets from ACF Image Field
- Is there a way to upscale a media library original image to the nearest whole pixel in WordPress?
- How to make Media Library files private?
- Media Library Issues
- Trying WP editor to load full size image (not ‘300×300’)
- Why are PDF thumbnails over-saturated?