[wp-hackers] wp_register_script with mootools or private javascript

Otto otto at ottodestruct.com
Sun Nov 9 15:17:18 GMT 2008


Also, don't bother calling "register script". Just enqueue the thing.

wp_enqueue_script('moocore',
plugins_url('/myplugin/js/mootools-1.2-core.js'), array(), '1.2');
wp_enqueue_script('moomore',
plugins_url('/myplugin/js/mootools-1.2-more.js'), array('moocore'),
'1.2');


On Sun, Nov 9, 2008 at 6:49 AM, Austin Matzko <if.website at gmail.com> wrote:
> 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'));
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list