From a8fe109dcd93e30cad751384f10fdd674d6b3808 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 27 Mar 2014 00:06:50 +0000 Subject: [PATCH] Add the 'attachment_' prefix to caption IDs after editing, see #24409 git-svn-id: https://develop.svn.wordpress.org/trunk@27764 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 );