Home › Forums › Front-end Issues › Using ACF to Delete Post From Frontend › Reply To: Using ACF to Delete Post From Frontend
You are also missing the 3rd piece.
The first piece of code is JavaScript that adds a button to any form inside a element with a class of “edit-proj-form”
<div class="edit-proj-form">
ACF form added here
</div>
Then at the bottom of the page you find a 2nd JS. This is called when the button is clicked to set a hidden true false field to true.
This depends on the previous discussion about adding a field to the field group that is hidden by CSS.
When the acf/save_post action runs it is looking for this field to be set to true and it it is it deletes the post.
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.