Make WordPress Core

Changeset 19865


Ignore:
Timestamp:
02/08/2012 03:29:24 PM (15 years ago)
Author:
nacin
Message:

Wait until init to fire wp_default_scripts. Fixes localization issues when a plugin calls wp_enqueue_script() too early (in spite of the _doing_it_wrong warning signs added in #11526). fixes #19959.

File:
1 edited

Legend:

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

    r19832 r19865  
    3232
    3333        function __construct() {
     34                if ( 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        }
Note: See TracChangeset for help on using the changeset viewer.