diff --git a/wp-includes/js/media-editor.js b/wp-includes/js/media-editor.js
index d0021be3fd..739747cb67 100644
--- a/wp-includes/js/media-editor.js
+++ b/wp-includes/js/media-editor.js
@@ -555,7 +555,8 @@
options = {
id: attachment.id,
- post_content: attachment.description
+ post_content: attachment.description,
+ post_excerpt: caption,
};
if ( props.linkUrl )
@@ -563,7 +564,6 @@
if ( 'image' === attachment.type ) {
html = wp.media.string.image( props );
- options.post_excerpt = caption;
_.each({
align: 'align',
diff --git a/wp-includes/media.php b/wp-includes/media.php
index 108a2fbd59..b3594f5c8f 100644
--- a/wp-includes/media.php
+++ b/wp-includes/media.php
@@ -1751,6 +1751,10 @@ function wp_print_media_templates() {
<# } #>
/>
+
<# } #>