Add the 'attachment_' prefix to caption IDs after editing, see #24409

Built from https://develop.svn.wordpress.org/trunk@27764


git-svn-id: http://core.svn.wordpress.org/trunk@27601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-03-27 00:07:14 +00:00
parent a450512b7b
commit cb489f5a9c
3 changed files with 4 additions and 5 deletions

View File

@ -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 = '<dl id="'+ imageData.attachment_id +'" class="wp-caption '+ className +'" style="width: '+ width +'px">' +
html = '<dl ' + id + 'class="wp-caption '+ className +'" style="width: '+ width +'px">' +
'<dt class="wp-caption-dt">'+ html + '</dt><dd class="wp-caption-dd">'+ imageData.caption +'</dd></dl>';
node = editor.dom.create( 'div', { 'class': 'mceTemp' }, html );

File diff suppressed because one or more lines are too long