Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#19959 closed defect (bug) (fixed)

Fix localization issues when a plugin calls wp_enqueue_script() too early

Reported by: nacin's profile nacin Owned by: nacin's profile nacin
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: I18N Keywords:
Focuses: Cc:

Description

Follow-up to #11526. After digging through this some more, the attached change to WP_Scripts should be just fine for all locales.

Attachments (1)

19959.diff (428 bytes) - added by nacin 12 years ago.

Download all attachments as: .zip

Change History (8)

@nacin
12 years ago

#1 @nacin
12 years ago

This doesn't work, but I bet there is a solution at hand.

#3 @azaozz
12 years ago

Thinking it would make sense to run that action early on "init":

add_action( 'init', array( $this, 'init' ), 1 ); 

#4 @rfair404
12 years ago

  • Cc rfair404 added

#5 @nacin
12 years ago

Works fine with the test, but fails when nothing is attached too early. This is because we're already at the init hook by the time we try to attach something to init.

#6 @nacin
12 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [19865]:

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.

#7 @nacin
12 years ago

In [19872]:

Coverage for load-scripts.php. fixes #19959.

Note: See TracTickets for help on using tickets.