Support

Account

Home Forums General Issues Acf_form stop executing and return error

Solving

Acf_form stop executing and return error

  • Hi guys,

    2 questions:

    1) How can i stop an acf_form() from executing?

    2) How can i return an error to the front-end acf_form()?

    I will perform some checks from acf/pre_save_post.

    Thanks

  • 1) To stop the form from executing I just didn’t run the wp_insert_post() if there was an error.

    2) I returned a message like this:

    $_POST['return'] = add_query_arg( array('post_id' => $post_id, 'message' => $message), $_POST['return'] );

    For sure there are better ways, but so far this is how is solved it.

  • 1) This solution caused problems….. If I do this all my ACF forms are pre-filled from that moment on. So need another way….

    2) Looks fine so far

    Any suggestions?

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

The topic ‘Acf_form stop executing and return error’ is closed to new replies.