Home › Forums › Backend Issues (wp-admin) › Update value by 1 onclick › Reply To: Update value by 1 onclick
The topic is too complex for a simple explanation or providing simple code examples. The best I can do is to give you an outline of what would be needed.
The first thing you’ll need to do is read about AJAX in WP, the best source of information in this is here https://codex.wordpress.org/AJAX_in_Plugins. You need to create AJAX what will make a request to update the value.
If you want to be able to reduce the value you not only need to know how many times it was clicked, you will need to record who clicked it. This will involve the user’s profile keeping track of all the posts they’ve liked and if there is not a profile it will involve cookies or some other mechanism for knowing if the person viewing the page has already liked it or not. This will all depend on how the site is set up and how visitors use the site.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.