mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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:
parent
a450512b7b
commit
cb489f5a9c
@ -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
Binary file not shown.
Loading…
Reference in New Issue
Block a user