Working with JavaScript and WordPress
This course will help you avoid the pitfalls of using JavaScript when developing with WordPress, and introduces the WP REST API.
What you'll learn
There are a number of possible pitfalls when using JavaScript and WordPress together, such as conflicts with JavaScript files loaded by other plugins and the theme on a site, security when passing data between JavaScript and the WordPress database, and site performance. This course will show you how to help avoid these pitfalls and introduce you to the new WP REST API available starting in WordPress 4.4. You should have a WordPress site set up locally on your machine which you can do with a number of tools (VVV, MAMP, WAMP, etc).
Table of contents
- Overview 3m
- When to Call wp_enqueue_script 4m
- Localizing Your Script and Passing Data 5m
- Notes on Using jQuery in WordPress 1m
- Demo: Prevent Adding Posts with no Featured Image 9m
- Demo: Using jQuery UI on the Front End 4m
- Adding Within a Theme 1m
- Using PHP Classes 1m
- Registering Multiple Scripts 3m
- Adding Multiple JavaScript Files 2m
- Summary 2m