• Resolved Begin

    (@bentalgad)


    Is it possible to set form action to be triggerd only on specific field condition?

Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    You can prevent an action from being processed using the related “prepare” hook. For example, for the Post Action, you can use theacfe/form/prepare_post hook (see documentation), and return false to stop the action, and go to the next one. You’ll find the same “prepare” hooks in other actions too.

    Usage example:

    add_filter('acfe/form/prepare_post/form=my-form', 'my_post_prepare', 10, 2);
    function my_post_prepare($action, $form){

    // if user isn't logged in
    // do not create/update the post
    // and go to the next action
    if(!is_user_logged_in()){
    return false;
    }

    // return normally
    return $action;

    }

    Hoep it helps!

    Have a nice day!

    Regards.

Viewing 1 replies (of 1 total)

The topic ‘Conditional logic actions’ is closed to new replies.