From 089284dadd3aacaf06ea4fdabf83ac0155b96c60 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 9 Jan 2008 20:11:13 +0000 Subject: [PATCH] JIT load tinymce localization to avoid load order problems. Props mdawaffe. fixes #5605 git-svn-id: https://develop.svn.wordpress.org/trunk@6587 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/script-loader.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index d5efa37d78..e5234cf0f1 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -34,7 +34,6 @@ class WP_Scripts { $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20080105' ); - $this->localize( 'wp_tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) ); $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6'); @@ -435,6 +434,12 @@ function wp_prototype_before_jquery( $js_array ) { return $js_array; } +// These localizations require information that may not be loaded even by init +function wp_just_in_time_script_localization() { + wp_localize_script( 'wp_tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) ); +} + +add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' ); add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' ); ?>