Make WordPress Core


Ignore:
Timestamp:
06/26/2012 05:33:19 AM (12 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

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

    r20000 r21132  
    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 );
     34        $this->init();
     35        add_action( 'init', array( $this, 'init' ), 0 );
    3836    }
    3937
Note: See TracChangeset for help on using the changeset viewer.