[wp-hackers] How to enqueue default scrips in footer?

Otto otto at ottodestruct.com
Fri Sep 25 17:03:49 UTC 2009


For default scripts, if you want to force them to the footer when
they're not already:

global $wp_scripts;
$wp_scripts->add_data('comment-reply', 'group', 1 );

Then just enqueue as per normal:

wp_enqueue_script('comment-reply');


-Otto



2009/9/25 Tynan Colin Beatty <junsuijin at gmail.com>:
> {{{
> global $wp_scripts;
>
> wp_enqueue_script(
>    'comment-reply',
>    $wp_scripts->registered['comment-reply']->src,
>    $wp_scripts->registered['comment-reply']->deps,
>    $wp_scripts->registered['comment-reply']->ver,
>    true // print in footer
> );
> }}}
>
> it would be nice if there was a simpler approach tho. maybe this merits a
> trac ticket.
>
> peace~
>
> On Fri, Sep 25, 2009 at 5:45 AM, scribu <scribu at gmail.com> wrote:
>
>> Most default scripts are included in the footer, when possible. It's
>> usually
>> a plugin that forces jQuery, for example, to be loaded in the head.
>>
>>
>> On Fri, Sep 25, 2009 at 7:14 AM, Milan Dinić <liste at srpski.biz> wrote:
>>
>> > I know how to load custom scripts but what about custom ones? (
>> >
>> >
>> http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Default_scripts_included_with_WordPress
>> > )
>> > _______________________________________________
>> > wp-hackers mailing list
>> > wp-hackers at lists.automattic.com
>> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>> >
>>
>>
>>
>> --
>> http://scribu.net
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
> _______________________________________________
> 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