[wp-hackers] Loading scripts in WordPress

Haluk Karamete halukkaramete at gmail.com
Tue Dec 10 22:45:44 UTC 2013


it is quite clear now... thank you...


On Tue, Dec 10, 2013 at 2:25 PM, John Blackbourn
<johnbillion+wp at gmail.com>wrote:

> On 10 December 2013 22:20, Haluk Karamete <halukkaramete at gmail.com> wrote:
>
> > >> you can simply call wp_enqueue_script() inside your shortcode
> > callback, which will ensure that your scripts only get enqueued when the
> > shortcode is parsed.
> >
> > That's interesting Chip. I thought that would have been too late.
> > Isn't it that when the "the_content()" is running, wp_head action hook
> has
> > already been executed?
> >
>
> If you call wp_enqueue_script() after the_header() then the script will be
> enqueued in the footer. Dependencies will work as expected. (This wasn't
> always the case, it was added in 3.3)
>
> John
> _______________________________________________
> 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