diff --git a/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js b/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js index 9e448b782a..3ba19b47bc 100644 --- a/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js @@ -186,7 +186,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { } function updateImage( imageNode, imageData ) { - var className, width, node, html, captionNode, nodeToReplace, uid, editedImg; + var className, width, node, html, captionNode, nodeToReplace, uid, editedImg, id; if ( imageData.caption ) { @@ -199,11 +199,10 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { } className = 'align' + imageData.align; - - //TODO: shouldn't add the id attribute if it isn't an attachment + id = imageData.attachment_id ? 'id="attachment_'+ imageData.attachment_id +'" ' : ''; // should create a new function for generating the caption markup - html = '
' + + html = '
' + '
'+ html + '
'+ imageData.caption +'
'; node = editor.dom.create( 'div', { 'class': 'mceTemp' }, html );