Yes, you’re right that the slimImageObject
function is the reason why you’re seeing/getting only those limited list of props.
But don’t worry, you can use wp.data.select( 'core' ).getMedia( <attachment id> )
to get the attribution
meta (and any other meta or props in the full attachment object). Here’s an example that worked for me:
items.map((item, index) => {
// Add this line and the attribution part in the attachment div.
const attribution = wp.data.select( 'core' ).getMedia( item.id )?.meta?.attribution;
return (
<div className="attachment" key={index}>
<figure>
<img src={item.url} alt={item.alt} key={item.id} />
</figure>
Attribution: { attribution || 'NA' }
</div>
)
})
Related Posts:
- How to display a shortcode caption somewhere other than the_content
- Extend core block attributes in post content
- How to change an image source when rendering on frontend?
- Surround uploaded image link with div
- Define how an attached image is rendered
- Filter to remove image dimension attributes?
- Programmatically adding images to media library
- Programmatically get images by URL and save in uploads folder
- How to extend the gallery block in Gutenberg?
- how to get original image using wp_get_attachment_image_src
- Can I attach image to post without adding it to post?
- Set default image link target in Gutenberg image block
- WordPress adding scaled images that don’t exist (1536×1536 and 2048×2048)
- Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords
- get_post_gallery with Gutenberg
- wp_get_attachment_image_src and server path
- Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
- How to find attachment by it’s name?
- Change WordPress image URLs via filter
- Always use for post images
- Change html structure of all img tags in WordPress
- Default Image Link Removal
- Remove title attribute from images
- How do I delete all generated images from my server except those currently used in posts
- Insert an image into a post by API
- Function to call the attachment image from post
- hook into completed image upload filter
- Theme Customiser Image Control
- How can I hide media library images from general users?
- Get attachment ID of author_meta image – Attachment Metadata
- How to include externally hosted images into a gallery block
- Associate an existing image with a post
- Need help building a filter to edit the output of “image_send_to_editor”
- Programatically creating image attachments from local URLs and setting featured image
- Apply image width to tag
- Filter Media Library by author or post_parent
- Preview Image Path in Admin Section
- How do i upload an image and return the image id?
- Get Attachment ID from URL [duplicate]
- How to remove title attribute from gallery links and images
- Separate attachment images from post loop
- copy attachment title to description and alt text
- Get an image from url in front end submission form
- Alter image output in content
- How can I remove the image attachment ALT field?
- Open the attachment details modal
- How to upload image without post ID using the new media uploader?
- How do I delete thousands of unattached images?
- add data-attribute to all images inside the_content()
- Allowing post attachments without allowing to insert in text
- Applying class to links around self hosted images embedded to posts/pages
- Rename attachments during upload
- Filter to modify post_title after image upload?
- How to link Gutenberg Gallery images To Media file automatically?
- Regex to turn embedded images in to attachments
- Re-process Images
- Show prev and next post links for parent post of current image in attachment page?
- Pulling Post Image Attachments in WordPress 3.9
- Change html structure of all img tags in WordPress
- Link Featured Thumb to Attachment Page, If Possible
- How to Add extra option to Image Block Settings?
- Regenerate missing _wp_attachment_metadata
- @wordpress/create-block image url in css
- Make alt text required when setting a featured image
- Best way to programatically add “rel” attributes to page and post images
- Image still linked as attachment to page even though it has been deleted
- Disable wordpress image sizes generation
- How to remove buttons from gutenberg toolbar
- Display one random image, but only if landscape
- get_attachment_id() only get id of first attached image after post update
- Why can I not view image attachment pages?
- Gutenberg editor get post featured image by id
- Is there a way to get attachment data?
- What’s the proper way to use the get_image_tag filter?
- hardcrop images in gutenberg “latest posts” block
- How to change image url?
- Add a new data attribute in tag
- Can I the caption shortcode to set caption to a data attribute, and with the image’s alignment intact?
- Custom page template to display all image attachments
- Link to full size image or attachment page in photo theme
- get the image of the post
- add the post as canonical for attachment page wordpress
- How to get image ID to use inside wp_read_image_metadata()?
- media_sideload_image with rewritten urls?
- Bulk edit Gutenberg single images to change from linking to media file to attachment page
- Trying to create a mouseover effect in html using Gutenberg editor
- Add an attribute to attachments
- Out of memory error reporting
- How can I attach hotlinked images in posts/pages within the same server?
- Multiple images in one attachment page
- WordPress Image Attachment using remote image
- Is there any action/filter hook to use when an image gets edited in the editor?
- Exclude images from “inserted into post” when trying to get attachments
- How to remove attachments size attribute [duplicate]
- WordPress adds extra width to post images container boxes
- Handling image uploads without thickbox
- Pull images from the gallery
- Prevent Image Pasting in RichText Component
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- Customizing the attachement page to show rest of all images in a gallery from post