mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
If a plugin triggers the WP_Scripts constructor prior to init, fire wp_default_scripts()
then and again on init. Only add our localized strings once we've fired init, in case we do have the situation where we fire wp_default_scripts() twice. Fixes issues where plugins or themes try to enqueue a default script handle prior to init. Does not allow #19959 to regress. see #20971 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@21132 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -31,10 +31,8 @@ class WP_Scripts extends WP_Dependencies {
|
||||
var $default_dirs;
|
||||
|
||||
function __construct() {
|
||||
if ( ! function_exists( 'did_action' ) || did_action( 'init' ) )
|
||||
$this->init();
|
||||
else
|
||||
add_action( 'init', array( $this, 'init' ), 0 );
|
||||
$this->init();
|
||||
add_action( 'init', array( $this, 'init' ), 0 );
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
Reference in New Issue
Block a user