admin管理员组

文章数量:1315246

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?

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?

Share Improve this question asked May 28, 2015 at 16:40 syntacularsyntacular 112 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

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: https://developer.wordpress/reference/functions/get_media_item/

本文标签: imagesOpen the attachment details modal