[wp-hackers] Adding Additional Attributes in Script Tag for 3rd party JS

Andrew Bartel andrew.bartel at gmail.com
Mon Aug 26 23:38:56 UTC 2013

Thanks for the quick response and thorough explanation Otto.


On Mon, Aug 26, 2013 at 3:36 PM, Otto <otto at ottodestruct.com> wrote:

> On Mon, Aug 26, 2013 at 5:11 PM, Andrew Bartel <andrew.bartel at gmail.com>
> wrote:
> > What's the best way to get those included when using the
> > wp_enqueue_script() function?
> There is no way to do this short of overriding the WP_Scripts class
> entirely to allow for extra attributes.
> Even then, it's not possible to override WP_Scripts properly because
> it's explicitly declared as a new class without a check or override in
> a few admin places (load-scripts, customize, etc).
> So basically, print it out yourself in the relevant *_head or
> *_print_scripts action. No good way to enqueue it.
> -Otto
> _______________________________________________
> 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