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.
git-svn-id: https://develop.svn.wordpress.org/trunk@19865 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6fe3f7639e
commit
b90754dbca
|
@ -31,6 +31,13 @@ class WP_Scripts extends WP_Dependencies {
|
||||||
var $default_dirs;
|
var $default_dirs;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
if ( did_action( 'init' ) )
|
||||||
|
$this->init();
|
||||||
|
else
|
||||||
|
add_action( 'init', array( $this, 'init' ), 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
do_action_ref_array( 'wp_default_scripts', array(&$this) );
|
do_action_ref_array( 'wp_default_scripts', array(&$this) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue