[wp-hackers] wp_register_script with mootools or private javascript

Austin Matzko if.website at gmail.com
Sun Nov 9 12:49:57 GMT 2008


On Sat, Nov 8, 2008 at 11:12 AM, Daiv Mowbray <daiv at daivmowbray.com> wrote:
> The following fails to load the javascript files completely.
> I suspect that I'm missing something here.

The problem is that you're giving 'moocore' a dependency that's a blank string.

>        wp_register_script('moocore',
> plugins_url('/myplugin/js/mootools-1.2-core.js'), array(''), '');

Instead, when there are no dependencies, just let the function handle
the defaults, like so:

wp_register_script('moocore', plugins_url('/myplugin/js/mootools-1.2-core.js'));


More information about the wp-hackers mailing list