WordPress.org

Make WordPress Core

Ticket #5921: script-loader.patch

File script-loader.patch, 1.0 KB (added by azaozz, 7 years ago)
  • script-loader.php

     
    3838                // Modify this version when tinyMCE plugins are changed. 
    3939                $mce_version = apply_filters('tiny_mce_version', '20080221'); 
    4040                $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); 
    41                 $this->localize( 'tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) ); 
    4241                 
    4342                $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6'); 
    4443 
     
    484483        return $js_array; 
    485484} 
    486485 
     486// These localizations require information that may not be loaded even by init  
     487function wp_just_in_time_script_localization() {  
     488        wp_localize_script( 'tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) );  
     489} 
     490 
     491add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );  
    487492add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' ); 
    488493 
    489494?>