diff --git a/wp-admin/js/media-upload.js b/wp-admin/js/media-upload.js index 2b9681517f..3a034ac9fc 100644 --- a/wp-admin/js/media-upload.js +++ b/wp-admin/js/media-upload.js @@ -5,8 +5,10 @@ function send_to_editor(h) { if (tinymce.isIE) ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark); + if ( h.indexOf('[wp_caption') != -1 ) + h = ed.plugins.wpeditimage._do_shcode(h); + ed.execCommand('mceInsertContent', false, h); - ed.execCommand('mceCleanup'); } else edInsertContent(edCanvas, h); diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js index adad1a35f9..89b4d71715 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js @@ -460,14 +460,13 @@ var wpImage = { tinyMCEPopup.close(); return; } else { - if ( DL ) { + if ( DL && DIV ) { if ( f.link_href.value ) html = ed.dom.getOuterHTML(ed.dom.getParent(el, 'a')); else html = ed.dom.getOuterHTML(el); P = ed.dom.create('p', {}, html); - DL.parentNode.insertBefore(P,DL); - ed.dom.remove(DL.childNodes); - ed.dom.remove(DL); + DIV.parentNode.insertBefore(P, DIV); + ed.dom.remove(DIV); } } diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php index 8a2ff725a7..5959c87587 100644 --- a/wp-includes/js/tinymce/tiny_mce_config.php +++ b/wp-includes/js/tinymce/tiny_mce_config.php @@ -222,7 +222,7 @@ if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) { // Setup cache info if ( $disk_cache ) { - $cacheKey = apply_filters('tiny_mce_version', '20080626'); + $cacheKey = apply_filters('tiny_mce_version', '20080702'); foreach ( $initArray as $v ) $cacheKey .= $v; diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 8312842d6b..b9bb7150ac 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -34,7 +34,7 @@ function wp_default_scripts( &$scripts ) { $visual_editor = apply_filters('visual_editor', array('tiny_mce')); $scripts->add( 'editor', false, $visual_editor, '20080321' ); - $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080701' ); + $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080702' ); // Modify this version when tinyMCE plugins are changed. $mce_version = apply_filters('tiny_mce_version', '20080701'); @@ -159,7 +159,7 @@ function wp_default_scripts( &$scripts ) { 'edit' => __('Edit'), ) ); $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080520' ); - $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080701' ); + $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080702' ); $scripts->localize( 'upload', 'uploadL10n', array( 'browseTitle' => attribute_escape(__('Browse your files')), 'back' => __('« Back'),