WordPress.org

Make WordPress Core

Changeset 28012


Ignore:
Timestamp:
04/07/2014 09:34:18 PM (6 years ago)
Author:
azaozz
Message:

TinyMCE: show an error in the console when a plugin attempts to use the 'wpdialogs' plugin but wpdialog.js is not enqueued, fixes #16284

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js

    r26900 r28012  
    3030        }
    3131
     32        if ( typeof jQuery === 'undefined' || ! jQuery.wp || ! jQuery.wp.wpdialog ) {
     33            // wpdialod.js is not loaded
     34            if ( window.console && window.console.error ) {
     35                window.console.error('wpdialog.js is not loaded. Please set it as dependency for your script when calling wp_enqueue_script().');
     36            }
     37
     38            return;
     39        }
     40
    3241        wp.$element = $element = jQuery( '#' + args.id );
    3342
     
    3645        }
    3746
    38         if ( window && window.console ) {
     47        if ( window.console && window.console.log ) {
    3948            window.console.log('tinymce.WPWindowManager is deprecated. Use the default editor.windowManager to open dialogs with inline HTML.');
    4049        }
Note: See TracChangeset for help on using the changeset viewer.