Make WordPress Core


Ignore:
Timestamp:
01/26/2009 12:59:10 PM (16 years ago)
Author:
azaozz
Message:

Improvements to the script loader: allows plugins to queue scripts for the front end head and footer, adds hooks for server side caching of compressed scripts, adds support for ENFORCE_GZIP constant (deflate is used by default since it's faster), see #8628, fixes #8884

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class.wp-scripts.php

    r10367 r10442  
    2727    var $print_html = '';
    2828    var $print_code = '';
    29     var $src = '';
     29    var $ext_handles = '';
     30    var $ext_version = '';
    3031    var $default_dirs;
    3132
     
    100101            if ( $this->in_default_dir($srce) ) {
    101102                $this->print_code .= $this->print_scripts_l10n( $handle, false );
    102                 $this->concat .= $handle . ',';
    103                 $this->concat_version .= $ver;
     103                $this->concat .= "$handle,";
     104                $this->concat_version .= "$handle$ver";
    104105                return true;
     106            } else {
     107                $this->ext_handles .= "$handle,";
     108                $this->ext_version .= "$handle$ver";
    105109            }
    106110        }
     
    111115        }
    112116
    113         $this->src .= "$src,";
    114117        $src = add_query_arg('ver', $ver, $src);
    115118        $src = clean_url(apply_filters( 'script_loader_src', $src, $handle ));
     
    147150    }
    148151
    149     function all_deps( $handles, $recursion = false ) {
     152    function all_deps( $handles, $recursion = false, $group = false ) {
    150153        $r = parent::all_deps( $handles, $recursion );
    151154        if ( !$recursion )
     
    182185        return false;
    183186    }
     187
     188    function reset() {
     189        $this->do_concat = false;
     190        $this->print_code = '';
     191        $this->concat = '';
     192        $this->concat_version = '';
     193        $this->print_html = '';
     194        $this->ext_version = '';
     195        $this->ext_handles = '';
     196    }
    184197}
Note: See TracChangeset for help on using the changeset viewer.