Submission Processing Hooks

While most modifications to the Form Processing Flow should exist as custom actions, there are some circumstances for otherwise filtering the data at different places during the flow.

The general flow works in the following order:

  1. Field Validation
  2. Field Processing
  3. Action Processing

Before Processing

Before the form is processed, form submission data is filterable using the ninja_forms_submit_data hook:

FILTER: apply_filters( ‘ninja_forms_submit_data’, $form_data );

The passed array parameter contains field data, form settings, and extra data submitted by the form.

Field Validation

During field validation each field’s settings are filtered before calling the respective field’s validate() method.

FILTER: ninja_forms_pre_validate_field_settings

Field Processing

Each field’s registered type has a process() method by which a field’s data can be modified before actions are processed.

See: Field Registration

Action Processing

Before being processed, the form’s actions are filterable. This is a good place to dynamically remove any actions from processing.

FILTER: ninja_forms_submission_actions

 

Before each individual form action is processed, its settings are filterable.

FILTER: ninja_forms_run_action_settings

 

Before an action is triggered, a filter runs to determine if that action should be processed.

FILTER: ninja_forms_run_action_type_$type

After Processing

Lastly, after the submission processing, an action hook fires with the relevant form data.

ACTION: ninja_forms_after_submission`