Bit Form
Limited-time offer
This deal ends ASAP!
Bit Form Logo
Estimated reading: 10 minutes 521 views

PHP Filter Hooks – Bit Form

Here are some of the main Bit Forms PHP filter hooks:​

  1. bitform_filter_format_submitted_data
  2. bitform_filter_save_form_entry
  3. bitform_filter_user_details
  4. bitform_filter_save_entry_user_details
  5. bitform_filter_return_submit_success
  6. bitform_filter_submission_log_data
  7. bitform_filter_update_form_entry
  8. bitform_filter_update_entry_user_details
  9. bitform_filter_return_edit_success
  10. bitform_filter_before_workflow_onload_fields
  11. bitform_filter_after_workflow_onload_fields
  12. bitform_filter_wp_user_auth_response
  13. bitform_filter_form_validation
  14. bitform_filter_integration_run_failure_message

bitform_filter_format_submitted_data

Description:

If you want to modify the submitted data before it is saved or update to the database, you can use this filter. The filter receives the submitted data as an array and the form ID as a parameter.

apply_filters('bitform_filter_format_submitted_data', $submitted_data, $this->form_id);

Usage:

The following example shows how to modify the submitted data before it is saved to the database.

add_filter('bitform_filter_format_submitted_data', 'your_function_name', 10, 2);

function your_function_name($submittedData, $formId) {
    // Modify the submitted data here
    return $submittedData;
}

Parameters:

  • $submittedData (array) (required) The submitted data as an array.
  • $formId (int) (required) The form ID.
$submission_data = [
    // fieldKey => value
    'b1-1' => 'value1',
    'b1-2' => 'value2',
]

bitform_filter_save_form_entry

Description:

If you want to modify the form entry before it is saved to the database, you can use this filter. The filter receives the submitted data as an array and the form ID as a parameter.

apply_filters('bitform_filter_save_form_entry', $submitted_data, $this->form_id);

Usage:

The following example shows how to modify the form entry before it is saved to the database.

add_filter('bitform_filter_save_form_entry', 'your_function_name', 10, 2);

function your_function_name($submittedData, $formId) {
    // Modify the form entry here
    return $submittedData;
}

Parameters:

  • $submittedData (array) (required) The submitted data as an array.
  • $formId (int) (required) The form ID.
$submission_data = [
    // fieldKey => value
    'b1-1' => 'value1',
    'b1-2' => 'value2',
]

bitform_filter_user_details

Description:

This filter available just modify the user details before it is save or update to the database, you can use this filter. The filter receives the user details as an array and the form ID as a parameter.

apply_filters('bitform_filter_user_details', $user_details, $this->form_id);

Usage:

The following example shows how to modify the user details before it is saved to the database.

add_filter('bitform_filter_user_details', 'your_function_name', 10, 2);

function your_function_name($userDetails, $formId) {
    // Modify the user details here
    return $userDetails;
}

Parameters:

  • $userDetails (array) (required) The user details as an array.
  • $formId (int) (required) The form ID.
$user_details = [
    'ip' => 'user ip',
    'device' => 'user device',
    'id' => get_current_user_id(),
    'page' => 'user page',
    'time' => current_time('mysql'),
];

bitform_filter_save_entry_user_details

Description:

If you want to modify the user details before it is saved to the database, you can use this filter. The filter receives the user details as an array and the form ID as a parameter.

apply_filters('bitform_filter_save_entry_user_details', $user_details, $this->form_id);

Usage:

The following example shows how to modify the user details.

add_filter('bitform_filter_save_entry_user_details', 'your_function_name', 10, 2);

function your_function_name($userDetails, $formId) {
    // Modify the user details here
    return $userDetails;
}

Parameters:

  • $userDetails (array) (required) The user details as an array.
  • $formId (int) (required) The form ID.
$user_details = [
    'ip' => 'user ip',
    'device' => 'user device',
    'id' => get_current_user_id(),
    'page' => 'user page',
    'time' => current_time('mysql'),
];

bitform_filter_return_submit_success

Description:

If you want to modify the Workflow return on submission before it is returned to the user, you can use this filter. The filter receives the wWork Flow Returned On Submit as a array and the form ID as a parameter.

apply_filters('bitform_filter_return_submit_success', $workFlowreturnedOnSubmit, $this->form_id);

Usage:

The following example shows how to modify the success message.

add_filter('bitform_filter_return_submit_success', 'your_function_name', 10, 2);

function your_function_name($workFlowreturnedOnSubmit, $formId) {
    // Modify the success message here
    return $workFlowreturnedOnSubmit;
}

Parameters:

  • $workFlowreturnedOnSubmit (array) (required) The work flow returned on submit as an array.
  • $formId (int) (required) The form ID.
$workFlowreturnedOnSubmit = [
    'fields' => [
        'b1-1' => 'value1',
        'b1-2' => 'value2',
    ],
    'message' => 'Form Submitted Successfully',
    'msg_id' => 0,
    'dflt_message' => 1,
    'redirectPage' => 'redirectPage url',
    'triggerData' => [
        'mail' => array(),
        'integrations' => array(),
        'dblOptin' => array(),
        'logID' => 0,
    ],
    'cron' => 1,
    'entry_id' => 0,
];

bitform_filter_submission_log_data

Description:

This filter is available just use to modify the submission log data before it is saved to the database. The filter receives the submission log data as an array, form ID, and the type as a parameter.

apply_filters('bitform_filter_submission_log_data', $submissionLogData, $this->form_id, $type);

Usage:

The following example shows how to modify the submission log data before it is saved to the database.

add_filter('bitform_filter_submission_log_data', 'your_function_name', 10, 3);

function your_function_name($submissionLogData, $formId, $type) {
    // Modify the submission log data here
    return $submissionLogData;
}

Parameters:

  • $submissionLogData (array) (required) The submission log data as an array.
  • $formId (int) (required) The form ID.
  • $type (string) (required) The type as create or update submission log.
$submissionLogData = [
    'user_id'       => 'user id',
    'action_type'   => 'type', // create, update
    'log_type'      => 'entry',
    'ip'            => 'user ip',
    'form_entry_id' => 'entry_id',
    'content'       => null,
    'form_id'       => 'form id',
    'created_at'    => current_time('mysql'),
];

bitform_filter_update_form_entry

Description:

If you want to modify the form entry before it is updated to the database, you can use this filter. The filter receives the updated data as an array and the form ID as a parameter.

apply_filters('bitform_filter_update_form_entry', $updatedValue, $this->form_id);

Usage:

The following example shows how to modify the form entry before it is updated to the database.

add_filter('bitform_filter_update_form_entry', 'your_function_name', 10, 2);

function your_function_name($updatedValue, $formId) {
    // Modify the form entry here
    return $updatedValue;
}

Parameters:

  • $updatedValue (array) (required) The updated data as an array key as field key and value pair.
  • $formId (int) (required) The form ID.
$updatedValue = [
    'b1-1' => 'value1',
    'b1-2' => 'value2',
]

bitform_filter_update_entry_user_details

Description:

This filter is available just use to modify the user details before it is updated to the database. This filter called when update form entry. The filter receives the user details as an array and the form ID as a parameter.

apply_filters('bitform_filter_update_entry_user_details', $user_details, $this->form_id);

Usage:

The following example shows how to modify the user details before it is updated to the database.

add_filter('bitform_filter_update_entry_user_details', 'your_function_name', 10, 2);

function your_function_name($userDetails, $formId) {
    // Modify the user details here
    return $userDetails;
}

Parameters:

  • $userDetails (array) (required) The user details as an array.
  • $formId (int) (required) The form ID.
$user_details = [
    'ip' => 'user ip',
    'device' => 'user device',
    'id' => get_current_user_id(),
    'page' => 'user page',
    'time' => current_time('mysql'),
];

bitform_filter_return_edit_success

Description:

This filter is available just use to modify the Workflow return on edit form entry success it is returned to the edit success. This filter is called when Update Form Entry. The filter receives the Workflow Returned On Submit as a array and the form ID as a parameter.

apply_filters('bitform_filter_return_edit_success', $workFlowreturnedOnSubmit, $this->form_id);

Usage:

The following example shows how to modify the Workflow return on edit form entry success.

add_filter('bitform_filter_return_edit_success', 'your_function_name', 10, 2);

function your_function_name($workFlowreturnedOnSubmit, $formId) {
    // Modify the success message here
    return $workFlowreturnedOnSubmit;
}

Parameters:

  • $workFlowreturnedOnSubmit (array) (required) The work flow returned on submit as an array.
  • $formId (int) (required) The form ID.
$workFlowreturnedOnSubmit = [
    'fields' => [
        'b1-1' => 'value1',
        'b1-2' => 'value2',
    ],
    'message' => 'Form Submitted Successfully',
    'msg_id' => 0,
    'dflt_message' => 1,
    'redirectPage' => 'redirectPage url',
    'triggerData' => [
        'mail' => array(),
        'integrations' => array(),
        'dblOptin' => array(),
        'logID' => 0,
    ],
    'cron' => 1,
    'entry_id' => 0,
];

bitform_filter_before_workflow_onload_fields

Description:

If you want to modify the fields before the workflow onload, you can use this filter. The filter receives the fields as an array and the form ID as a parameter.

apply_filters('bitform_filter_before_workflow_onload_fields', $fields, $formID);

Usage:

The following example shows how to modify the submitted data before it is saved to the database.

add_filter('bitform_filter_before_workflow_onload_fields', 'your_function_name', 10, 2);

function your_function_name($fields, $formId) {
    // Modify the fields here
    return $fields;
}

Parameters:

  • $fields (array) (required) The fields as an array.
  • $formID (int) (required) The form ID.

bitform_filter_after_workflow_onload_fields

Description:

If you want to modify the fields after the workflow onload, you can use this filter. The filter receives the fields as an array and the form ID as a parameter.

apply_filters('bitform_filter_after_workflow_onload_fields', $fields, $formID);

Usage:

The following example shows how to modify the submitted data before it is saved to the database.

add_filter('bitform_filter_after_workflow_onload_fields', 'your_function_name', 10, 2);

function your_function_name($fields, $formId) {
    // Modify the fields here
    return $fields;
}

Parameters:

  • $fields (array) (required) The fields as an array.
  • $formID (int) (required) The form ID.

bitform_filter_wp_user_auth_response

Description:

If you want to modify the response of the WordPress user authentication, you can use this filter. The filter receives the response as an array, the submitted data as an array, and the parameter as a parameter.

apply_filters('bitform_filter_wp_user_auth_response', $result, $form_id, $_POST, $parameter)

Usage:

The following example shows how to modify the response of the WordPress user authentication.

add_filter('bitform_filter_wp_user_auth_response', 'your_function_name', 10, 4);
function your_function_name($result, $formId, $submittedData, $urlParameter) {
    // Modify the response here
    return $result;
}

Parameters:

  • $result (array) (required) The response of the WordPress user authentication as an array.
  • $formId (int) (required)
  • $submittedData(array) (required) The submitted data as an array.
  • $urlParameter (array) (required) The parameter.

bitform_filter_form_validation

Description:

If you want to modify the form validation before it is saved to the database, you can use this filter. The filter receives the form validation as a boolean and the form ID as a parameter.

apply_filters('bitform_filter_form_validation', $validated, $this->_form_id);

Usage:

The following example shows how to modify the form validation before it is saved to the database.

add_filter('bitform_filter_form_validation', 'your_function_name', 10, 2);
function your_function_name($validated, $form_id) {
// Modify the form validation here
return $validated;
}

Parameters:

  • $validated (boolean) (required) The form validation as a boolean.
  • $form_id (int) (required) The form ID.

bitform_filter_integration_run_failure_message

Description:

If you want to modify the integration run failure message before it is returned to the user, you can use this filter. The filter receives the integration run failure message as a string, integration ID, and form ID as a parameter.

apply_filters('bitform_filter_integration_run_failure_message', $messages, $integrationID, $formID);

Usage:

The following example shows how to modify the integration run failure message.

add_filter('bitform_filter_integration_run_failure_message', 'your_function_name', 10, 3);
function your_function_name($message, $integrationID, $formID) {
// Modify the integration run failure message here
return $message;
}

Parameters:

  • $message (string) (required) The integration run failure message as a string.
  • $integrationID (int) (required) The integration ID.
  • $formID (int) (required) The form ID.

Share this Doc

PHP Filter Hooks

Or copy link

CONTENTS
Subscribe for New Integrations Alert!
Join Community
4800+ Member's
Bit Apps
6500+ Videos
bit form dark logo
© Bit Form. All rights reserved.
Follow us
© 2024 ABC. All rights reserved by Bit Apps.