Support

Account

Home Forums Backend Issues (wp-admin) ACF PRO admin AJAX breaks custom post form submits

Helping

ACF PRO admin AJAX breaks custom post form submits

  • I’m adding custom buttons to the wp-admin post edit view to handle custom post status saving.

    On a site with no ACF the buttons work as they should, but on an ACF site ACF hijacks the submit procedure, does its own validation and then send the post form as if I had pressed “Update” or “Publish”, instead of pressing the custom buttons I have. This means I cannot hook to the $_POST and see whether a certain button was clicked on the form.

    Is there a way to exclude buttons from the ACF validation process or make the AJAX send the correct submit button instead of hijacking and making it send using the “Update” button?

  • Hi @ojrask,

    Thanks for the post.

    I believe you can hook into the acf/validate_save_post action that is fired when publishing a post and create some logic to bypass the process for the logged in user.

    This action and its usage is described here: https://www.advancedcustomfields.com/resources/acfvalidate_save_post/

    I hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘ACF PRO admin AJAX breaks custom post form submits’ is closed to new replies.