Javascript advice for WordPress Plugin Developers
Thanks for visiting! If you're new here, you may want to subscribe to our RSS feed. This blog posts regular Wordpress news, updates of themes, plugins, ideas, hacks, quick fixes and everything about blogging, especially about Wordpress. Go ahead, subscribe to our feed! You can also receive updates from this blog via email.
Load Javascript With Your WordPress Plugin: Sage advice from a seasoned and proven plugin developer for WordPress. Ozh talks about some neat javacript loading options and dos and don’t s for plugin developers who need to load various javascript libraries. If you use javascript in your plugin and are not aware of wp_enqueue_script, you need to head over to Ozh’s post.














Comments RSS
Well said !
Wow, that is a great explanation of wp_enqueue_script. Well done.
I can confirm that wp_enqueue_script also can be called from themes. I am using it to call jQuery library. In fact you can even enqueue your own JavaScript library to it will be added to the header.
Now when can we expect to get the wp_enqueue_css api?
Azizur,
Seriously, that would be neat. Something I’d love to see.
The best place, in my opinion, is to use wp_enqueue_script in the “functions.php” to load JavaScript files for themes.
[...] activated, the plugin will “listen” to all of the scripts added (via the WordPress wp_enqueue_script function) to your pages header and automagically switch the locally hosted library to a Google hosted one. [...]