Improved Ajax in WordPress: Procedural Programming

Years ago, I wrote a series of posts for Envato walking readers through how to use Ajax in WordPress.

Then, not long ago, I provided an updated walkthrough of how to do so with better practices (thanks to @gmazzap for the code review on that one).

One purpose of this blog is to provide articles for others who are getting started in WordPress development. That is, I want to share the things I’ve learned to help shortcut others’ learning.

Sometimes, this requires updating old content. Or it requires providing new ways of doing things already discussed.

Case in point: Using Ajax in WordPress.

Ajax in WordPress via Procedural Programming

One of the reasons that I enjoy writing for Envato is because it gives an opportunity to help educate others who have a sincere curiosity about programming.

Considering that Ajax in WordPress is one of those topics that was once at issue for me, I thought it would be a good idea to discuss it from an entry-level perspective.

Ajax in WordPress: Procedural Programming

So in my latest article, I begin talking about how to incorporate Ajax in WordPress via procedural programming.

In the article, I cover the following:

  • Setting up a plugin to do the work
  • How we originally added support for Ajax
  • An improved way to add support for Ajax
  • Setting up server side code
  • Making a request for non/authenticated users
  • Handling erroneous requests
  • …and more

There’s plenty of sample code that walks you through what you need to know to create a plugin of your own.

So if you’re just starting out and you’re looking for best practices on Ajax in WordPress, then checkout this article on Envato.

Comments on this post are closed. If you'd like to comment, then please see the original post.