Conditional Loading of Javascript-Files using WordPress (if IE)

Since version 4.2 it has become even more easy to load JavaScript files conditionally. Find out how this works in this blog post:

In your functions.php and/or in your plugin file you can use the follwoing function: wp_script_add_data():

Check your sourcecode on the frontend and you will find something like this:

That’s it.