Friday, 7 June 2019

WordPress Caldera Forms show error message on validation

I am trying to create a custom add-on for Caldera Forms. So basically I am creating a processor for Caldera Forms. In that add-on when someone tries to submit the form it should show a custom error. So for that I have done my code like this

add_action( 'caldera_forms_get_form_processors',   'wpcfmu_register_processor' );

function wpcfmu_register_processor() {
    $processors['wp_cf_mu_integration'] = array(
        "name"              =>  __('Custom Integration'),
        "description"       =>  __("Custom Plugin"),
        "author"            =>  'test',
        "pre_processor"    =>  'wpcfmu_pre_process',
    );

    return $processors;
}

function wpcfmu_pre_process($config, $form, $process_id) {
    $error = 'some happened wrong';
    return array(
        error =>$error,
        type' => 'error'
    );
}

But here no such is showing at all. I have tried to change the code but anyhow its showing the success message. Can someone tell me what going wrong here?

Any help and suggestion will be really appreciable.



from WordPress Caldera Forms show error message on validation

No comments:

Post a Comment