[wp-hackers] checking if post has shortcode, before header is output?

William Canino william.canino at googlemail.com
Fri Oct 23 23:07:35 UTC 2009

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 at unfocus.com>:
> 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 at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list