Support

Account

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.