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
This commit is contained in:
Joe McGill 2016-06-26 22:37:27 +00:00
parent 21ef286eef
commit f82e7ed434
2 changed files with 12 additions and 1 deletions

View File

@ -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; ?>
</div>
<div class="wp_attachment_details edit-form-section">

View File

@ -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.