diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index ebd82f1673..1d6d91a6b3 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -2285,8 +2285,9 @@ function edit_form_image_editor() { $title = esc_attr( $post->post_title ); $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); - $att_url = wp_get_attachment_url( $post->ID ); - + $att_url = wp_get_attachment_url( $post->ID ); ?> +
+ ID ) ) : $image_edit_button = ''; if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { @@ -2294,7 +2295,7 @@ function edit_form_image_editor() { $image_edit_button = " "; } ?> -
+
class="wp_attachment_image" id="media-head-"> @@ -2304,9 +2305,23 @@ function edit_form_image_editor() { class="image-editor" id="image-editor-">
-
- + post_mime_type, 'audio/' ) ): + echo do_shortcode( '[audio src="' . $att_url . '"]' ); + + elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'video/' ) ): + + $meta = wp_get_attachment_metadata( $attachment_id ); + $shortcode = sprintf( '[video src="%s"%s%s]', + $att_url, + empty( $meta['width'] ) ? '' : sprintf( ' width="%d"', $meta['width'] ), + empty( $meta['height'] ) ? '' : sprintf( ' height="%d"', $meta['height'] ) + ); + echo do_shortcode( $shortcode ); + + endif; ?> +