[wp-forums] JavaScript breakage? There's a bug for that.

Andrew Nacin wp at andrewnacin.com
Fri Jun 15 12:36:49 UTC 2012


Hello there,

I've seen some sporadic reports of JavaScript breakage, and was able to
track down the most likely culprit.

A version or two ago, we started issuing _doing_it_wrong() notices if you
registered a script before init, wp_enqueue_scripts, or
admin_enqueue_scripts, etc. (http://wp.me/pbNCB-t4) Most people cleaned up
their issues then, but we (well, I) broke something else in 3.4 that
prevents you from enqueueing a default core script prior to these actions.
So, something like wp_enqueue_script( 'jquery-ui-droppable' ) doesn't work
in functions.php or a plugin file body.

This breaking change isn't the end of the world, as it gets people to fix
up their very broken code. Now at least you now know what went wrong. This
one can be somewhat fixed in the Hotfix plugin (somewhat for plugins, and
completely for themes) so we may go that route in the next few days.

The bug report for this one is http://core.trac.wordpress.org/ticket/20971.

Nacin


More information about the wp-forums mailing list