]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
WordPress 4.3.1
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / wpeditimage / plugin.js
index 662a92a1edfc202c60e45921ae75be0dcc597ac3..2779cd39dd5a80cc369265a80021bd2172d7f6fd 100644 (file)
@@ -61,14 +61,16 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
        } );
 
        editor.once( 'preinit', function() {
-               toolbar = editor.wp._createToolbar( [
-                       'wp_img_alignleft',
-                       'wp_img_aligncenter',
-                       'wp_img_alignright',
-                       'wp_img_alignnone',
-                       'wp_img_edit',
-                       'wp_img_remove'
-               ] );
+               if ( editor.wp && editor.wp._createToolbar ) {
+                       toolbar = editor.wp._createToolbar( [
+                               'wp_img_alignleft',
+                               'wp_img_aligncenter',
+                               'wp_img_alignright',
+                               'wp_img_alignnone',
+                               'wp_img_edit',
+                               'wp_img_remove'
+                       ] );
+               }
        } );
 
        editor.on( 'wptoolbar', function( event ) {
@@ -88,7 +90,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
                                        editor.selection.select( node );
                                        editor.nodeChanged();
                                }, 200 );
-                       } else {
+                       } else if ( toolbar ) {
                                toolbar.hide();
                        }
                } );