[wp-hackers] Loading scripts in WordPress

Dave Navarro dave at topekadesign.com
Tue Dec 10 20:23:34 UTC 2013


Thank you for your quick response.  I'll take a look at that.

On 12/10/2013 2:22 PM, Chip Bennett wrote:
> Shortcodes are parsed at the the_content filter.
>
> That said: 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.
>
>
> On Tue, Dec 10, 2013 at 3:20 PM, Dave Navarro <dave at topekadesign.com> wrote:
>
>> At what point does WordPress process short codes in content?
>>
>> I have a short-code I created for displaying a custom Google map and I
>> only want to load the necessary javascript files if the short-code is used
>> on a page.  Are short-codes processed before the headers are sent to the
>> browser or after?
>>
>> Thanks!
>> _______________________________________________
>> 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