I tried to shorten that title as much as I could, but basically this article will explain, at a high level, how to update an Advanced Custom Field (ACF) in your WordPress theme by submitting a form through an AJAX request.
Why an ACF? Well, it doesn’t have to be for that. It’s only an example I’m using to demonstrate how data or inputs can be moved from a user form to the back end. Once you obtain the data in this way, you can do whatever you want with it.
Why through AJAX? This is the best part – it all happens without the browser having to refresh the page. (It’s done asynchronously.) Take a look at the diagram below and follow along with me.
By sheer quantity alone, yes, they’re annoying. Another new WordPress version arrives or one of the many plugins residing in your theme, and oh yes, a theme update too. There are the minor updates for fixing security bugs, like 4.1.1 to 4.1.2, and the major updates for new features, like 4.3 to 4.4. Along with the inevitable update, so too comes the same fear and confusion. What is the risk of using the latest version? Will a conflict arise? Will my site blow up? Fear and the unknown have always been good friends. For this case, allow me to try to break up that relationship by sharing some known stuff.
Using the latest version really is for your benefit. First, it’s best to understand why updates happen. There are a few good reasons, but number one is security.