Sure! Just follow this guide and make these changes:
- Hook into the
add_meta_boxes_attachment
action instead of theadd_meta_boxes
action - In the
add_meta_box()
call, pass'attachment'
as the$screen
parameter - Hook into the
save_post_attachment
action instead of thesave_post
action
And of course, make sure to customize the example code to your specific needs.
Related Posts:
- Upload multiple images in a custom metabox
- Adding upload button in metabox
- Image display from custom field
- Include captions
- WordPress Featured Image meta box not showing
- Image not showing using a custom function and get_post_meta
- Metabox image upload value
- featured image in custom poste type (backend)
- problem with updating metabox of upload image
- Upload button in metabox not working
- Adding different classes to different images depending on size for fine control of image layout in posts
- show hide image script after 4 seconds [closed]
- How do I disable responsive images in WP 4.4?
- How to delete resized (cropped) image uploads and prevent future resizing?
- After Moving a Site to Another Domain, All Images Are Lost
- How to display a page’s featured image?
- Featured image shortcode
- How to find attachment by it’s name?
- Cropped featured image replaces original image in gallery
- Change html structure of all img tags in WordPress
- Use Media upload in custom widget on wordpress 3.5
- Theme Customiser Image Control
- How to disable “insert into post” only when selecting the Featured Image?
- How to remove title attribute from gallery links and images
- How to increase media image scale limit?
- Dynamic-Image-Resize Plugin does not output anything
- How to default all users to no link for attachments?
- How to output placeholder image if no featured image set?
- Cannot access the thumbnails of attachment images… Cannot find the reason
- How to include a picture in a blog post such that it will show in Facebook?
- Remove ‘wp-content/themes/themename/’ from Image path
- Why html tags are being appended to my pictures?
- Set a background color per image added to a post
- add_image_size() to crop images into squares?
- How to create a simple slideshow out of a post image gallery?
- Lazyload post thumbnails
- Is there a way to change wordpress image resize settings?
- wordpress media library shows empty images
- How to change the target size of images clicked on in WordPress standard gallery
- Is my code is right to make image shortcode
- Adding different backgrounds for different pages
- Mobile Featured Image Bug
- How to remove p tags around img and iframe tags in the acf wysiwyg field
- If Media Type .GIF
- Pull images from the gallery
- Migrate image from my old blog
- the_post_thumbnail() image sizing problem?
- Imagick vs GD colour issues on image uploads
- How to add image and featured image to post by WP REST API
- Get ALT attribute from title post (code not work)
- How to configure sub-domain for images on Debian Apache VPS?
- Why it doesn’t show media urls on rest Api? (WordPress)
- Resize images in existing posts
- WordPress PNG compression issue
- “Unable to create new image” error in wordpress dashboard image editor
- Fallback image size when using wp_get_attachment_image_src / full size compressed image
- How can I add a ‘Click to Enlarge Image’ feature, with the enlarged image opening in a popup?
- Image editor is not loading
- Images give 404 after changing default domain
- Load Gallery Images with Title on Homepage BX Slider
- How can I check if the first block is an image aligned left or right?
- How would you add sequentially numbered labels to images in posts?
- Advice on image heavy site, compression and slow page loads
- Blurry images when using add_image_size with crop
- Auto delete pictures in media library by age
- Can wp_get_image_editor convert to icon?
- How to get image URL from media_sideload_image?
- Can’t get text to wrap around image
- Allow SVG in WP step by step
- Product Images Low Quality After Updating From WP 3.5 to 4 [closed]
- Auto-crop width, not height
- How can I change the to for lazyload wp smilies
- Convert featured images into “product images”
- Output posts attached images as thumbnails linked to full-size with lightbox class
- Making a parent directory writable by the server
- my featured image of wordpress are not showing in the front end though image are uploaded in media library
- Word press cutting sliding images – not displaying the entire image
- What is the best way to host a site with many images without it being too slow?
- Show featured image in all posts
- How to re-arrange images in default WP Gallery more than one image at once?
- After moving a site to new hosting, not all images are showing in media library
- How to inject alt and title attributes for every image in each post into HTML?
- Custom Background for each page and post
- How to see previous –next image option in the theme?
- How can the alt be added to this wooCommerce category image?
- Displaying “alt” attribute text as captions?
- After I upload a file to library its name converted to dashes
- Image to only show up in the single post page, not on the blog/home page
- Delete images of a particular size
- How do I display image files as links?
- 3.5.x Theme Customize: Handling Custom Control Requests
- Add category description to list of category with taxonomy image
- Images in sub-pages fail to load
- How do add custom class and id to the that is generated from media gallery insert image into post [duplicate]
- How do I get the URL of only the first picture in a WordPress post?
- Images getting corrupt automatically
- Thumbnail size keeps resetting automatically
- How to import external media items into wordpress media library (without using storage)
- How to return responsive images from a sanitize_callback?
- How to disable Right Click on a image? [closed]