Andrew Bartel
2013-08-26 22:11:11 UTC
Hi All,
I asked this question on WPSE:
http://wordpress.stackexchange.com/questions/110929/adding-additional-attributes-in-script-tag-for-3rd-party-js
(and
added a bounty if anyone's interested at taking a crack).
I encountered this trying to add the dropbox dropin chooser app to a plugin
I'm writing. Their directions are to include <script type=
"text/javascript" src="https://www.dropbox.com/static/api/1/dropins.js" id=
"dropboxjs" data-app-key="MY_APP_KEY"></script>' in the page.
I'm curious as to what the best practice is to pass additional attributes
to script tags so that the final output includes the attributes in the tag
itself. Including them with wp_localize_script() didn't seem to get them
registered by dropbox.
What's the best way to get those included when using the
wp_enqueue_script() function? Or is there an alternate function? Properly
hooked of course.
Thanks much,
Andrew
I asked this question on WPSE:
http://wordpress.stackexchange.com/questions/110929/adding-additional-attributes-in-script-tag-for-3rd-party-js
(and
added a bounty if anyone's interested at taking a crack).
I encountered this trying to add the dropbox dropin chooser app to a plugin
I'm writing. Their directions are to include <script type=
"text/javascript" src="https://www.dropbox.com/static/api/1/dropins.js" id=
"dropboxjs" data-app-key="MY_APP_KEY"></script>' in the page.
I'm curious as to what the best practice is to pass additional attributes
to script tags so that the final output includes the attributes in the tag
itself. Including them with wp_localize_script() didn't seem to get them
registered by dropbox.
What's the best way to get those included when using the
wp_enqueue_script() function? Or is there an alternate function? Properly
hooked of course.
Thanks much,
Andrew