[wp-hackers] Loading JS for widgets

Viper007Bond viper at viper007bond.com
Tue May 20 03:55:18 GMT 2008

You can output the JS inside your widget or just always output it in the
header regardless.

But to actually see if your widget is in use, call wp_get_sidebars_widgets()
and then loop through each array looking for your widget.

On Mon, May 19, 2008 at 7:36 AM, Aaron D. Campbell <aaron at xavisys.com>

> Is there a way to tell if your widget is going to be used on a page, so
> that you can enqueue JS before scripts get printed?
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

Viper007Bond | http://www.viper007bond.com/ | http://www.finalgear.com/

More information about the wp-hackers mailing list