From f82e7ed434d7d133046b7bbf2e015959d33b1d68 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Sun, 26 Jun 2016 22:37:27 +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. Built from https://develop.svn.wordpress.org/trunk@37879 git-svn-id: http://core.svn.wordpress.org/trunk@37820 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 11 +++++++++++ wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index cb3c2f2d28..9145362994 100644 --- a/wp-admin/includes/media.php +++ b/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; ?>
diff --git a/wp-includes/version.php b/wp-includes/version.php index e0deaf5183..a85d9fda8b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37878'; +$wp_version = '4.6-alpha-37879'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.