From 726057bc419c2b0bf199242b35443f94554325f7 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Sun, 26 Jun 2016 22:37:00 +0000 Subject: [PATCH] Media: Add action to display attachments on the edit screen. This adds a new action hook, `wp_edit_form_attachment_display` to `edit_form_image_editor()`, which can be used as a fallback to render previews of an attachment that isn't an image, audio, or video file included in the media library. Props georgestephanis. Fixes #36502. git-svn-id: https://develop.svn.wordpress.org/trunk@37879 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/media.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index cb3c2f2d28..9145362994 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -2766,6 +2766,17 @@ function edit_form_image_editor( $post ) { echo wp_video_shortcode( $attr ); + else : + + /** + * Fires when attachment type can't be rendered in the edit form. + * + * @since 4.6.0 + * + * @param WP_Post A post object. + */ + do_action( 'wp_edit_form_attachment_display', $post ); + endif; ?>