« Return to Thread: checking if post has shortcode, before header is output?

Re: checking if post has shortcode, before header is output?

by William Canino :: Rate this Message:

| View in Thread

This is not an answer but a praise to you for thinking this way.

Too many plugins require_once and wp_enqueue_script their entire
machinery at init or at wp_head without first checking whether the
page actually needs them.



2009/10/23 Kevin Newman <CaptainN@...>:

> Hello,
>
> Is there anyway to check if there your registered shortcode (for a plugin)
> is being used in the current post, during some action hook before the header
> is output? The idea would be to include CSS and JS files for the shortcode,
> only on pages that actually use the shortcode. I'm doing it inline right
> now, since wp_enqueue_script is not available where the shortcode is dealt
> with.
>
> Thanks,
>
> Kevin N.
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers@...
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

 « Return to Thread: checking if post has shortcode, before header is output?