From e28f610ead1e138e405512eb5de904f6284c403f Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 7 Apr 2014 22:54:13 +0000 Subject: [PATCH] Fix typo and add more text to the error shown when 'wpdialogs' is not enqueued. Add 'wp_enqueue_editor' action fired when scripts and styles for the editor are being enqueued, fixes #16284 git-svn-id: https://develop.svn.wordpress.org/trunk@28024 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-editor.php | 9 +++++++++ src/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index e62762363d..2b2b343886 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -733,6 +733,15 @@ final class _WP_Editors { add_thickbox(); wp_enqueue_script('media-upload'); } + + /** + * Fires when scripts and styles are enqueued for the editor + * + * @since 3.9.0 + * + * @param array An array containing boolean values whether TinyMCE and Quicktags are being loaded. + */ + do_action( 'wp_enqueue_editor', array( 'tinymce' => self::$has_tinymce, 'quicktags' => self::$has_quicktags ) ); } public static function wp_mce_translation() { diff --git a/src/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js b/src/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js index fef6aa079d..cd805f04b0 100644 --- a/src/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js @@ -30,9 +30,9 @@ tinymce.WPWindowManager = tinymce.InlineWindowManager = function( editor ) { } if ( typeof jQuery === 'undefined' || ! jQuery.wp || ! jQuery.wp.wpdialog ) { - // wpdialod.js is not loaded + // wpdialog.js is not loaded if ( window.console && window.console.error ) { - window.console.error('wpdialog.js is not loaded. Please set it as dependency for your script when calling wp_enqueue_script().'); + window.console.error("wpdialog.js is not loaded. Please set 'wpdialogs' as dependency for your script when calling wp_enqueue_script(). You may also want to enqueue the 'wp-jquery-ui-dialog' stylesheet."); } return;