Make WordPress Core

Ticket #5605: 5605.diff

File 5605.diff, 1022 bytes (added by mdawaffe, 17 years ago)
  • wp-includes/script-loader.php

     
    3434
    3535                $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php');
    3636                $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20080105' );
    37                 $this->localize( 'wp_tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) );
    3837
    3938                $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');
    4039
     
    435434        return $js_array;
    436435}
    437436
     437// These localizations require information that may not be loaded even by init
     438function wp_just_in_time_script_localization() {
     439        wp_localize_script( 'wp_tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) );
     440}
     441
     442add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );
    438443add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
    439444
    440445?>