Open the attachment details modal

The newer versions of WordPress, and possibly older ones, open an attachment details modal window when an image is selected in the media library. Is there a way that I can open this modal on a different admin page if I know the attachment’s ID? Specifically, can I click a button and have the modal window open?

WordPress Development Asked by syntacular on November 11, 2021

1 Answers

One Answer

Unfortunately the logic of the attachment details isn't made to be used standalone - it requires the grid that opens it. You can however use the get_media_item( attachment_id ) method to receive the HTML of the form for modifying images:

Answered by user63350 on November 11, 2021

Add your own answers!

Related Questions

How to handle image resize in media_handle_sideload?

1  Asked on January 10, 2021 by user1692333


apiFetch security

1  Asked on January 9, 2021


Use cron to create a non blocking task

2  Asked on January 7, 2021 by cyclonecode


Creating a slider shortcode to use with bxslider

0  Asked on January 6, 2021 by devsem


Redirect Admin User in Dashboard

4  Asked on January 5, 2021 by plumwd


Adding featured image to a new post using front-end form?

1  Asked on January 3, 2021 by davood-kazemi


Hook when post is set from published to draft?

1  Asked on January 2, 2021 by anton-emery


How to execute filter with WP Cli?

0  Asked on January 2, 2021 by efbi


Get HTTP response code on non-2xx apiFetch request

0  Asked on January 1, 2021 by nicholas-harris


Ask a Question

Get help from others!

© 2021 All rights reserved.