diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index 58ffd9a1a4..104eb11b8f 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -312,7 +312,6 @@ final class _WP_Editors { 'entities' => '38,amp,60,lt,62,gt', 'entity_encoding' => 'raw', 'menubar' => false, - 'object_resizing' => false, 'keep_styles' => false, 'paste_remove_styles' => true, diff --git a/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js b/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js index 577a5cec90..50db0d984a 100644 --- a/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js @@ -331,6 +331,15 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { }); }); + editor.on( 'ObjectResized', function( event ) { + var parent, + node = event.target; + + if ( node.nodeName === 'IMG' && ( parent = editor.dom.getParent( node, '.wp-caption' ) ) ) { + editor.dom.setStyle( parent, 'width', 10 + event.width + 'px' ); + } + }); + editor.on( 'BeforeExecCommand', function( e ) { var node, p, DL, align, cmd = e.command,