Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r19573 r20000  
    3232
    3333        function __construct() {
     34                if ( ! function_exists( 'did_action' ) || did_action( 'init' ) )
     35                        $this->init();
     36                else
     37                        add_action( 'init', array( $this, 'init' ), 0 );
     38        }
     39
     40        function init() {
    3441                do_action_ref_array( 'wp_default_scripts', array(&$this) );
    3542        }
    … …  
    3845         * Prints scripts
    3946         *
    40          * Prints the scripts passed to it or the print queue.  Also prints all necessary dependencies.
     47         * Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
    4148         *
    42          * @param mixed $handles (optional) Scripts to be printed.  (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
     49         * @param mixed $handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
    4350         * @param int $group (optional) If scripts were queued in groups prints this group number.
    4451         * @return array Scripts that have been printed
    … …  
    144151
    145152                if ( !empty($after) )
    146                         $script .= "\n$after";
     153                        $script .= "\n$after;";
    147154
    148155                $data = $this->get_data( $handle, 'data' );
    149156
    150157                if ( !empty( $data ) )
    151                         $script = "$data;\n$script";
     158                        $script = "$data\n$script";
    152159
    153160                return $this->add_data( $handle, 'data', $script );
Note: See TracChangeset for help on using the changeset viewer.