Divi Form Builder Hook List for Developers

Written by the Divi Engine Documentation Team

What Do Hooks Do?

Divi Form Builder allows you to create complex unique forms using our Custom Form option. This allows you to take control and use all the hooks we provide to build truly powerful API integrations and more. Please click HERE for detailed descriptions of each setting in the Form module.

Actions


df_before_process

do_action( 'df_before_process', string $form_id,  Array $post_array, String $form_type )

Description:
Fires after form is submitted and captcha checking is ok.
Parameters:
  • $form_id:  (String) Form ID from Form setting.
  • $post_array: (Array) Submitted fields from the form. Keys are mapped field names or custom field names (in case of Field Mapping Type is Custom).
  • $form_type : (String) Form Type

df_before_insert_post

do_action( 'df_before_insert_post', $form_id, $post_array )

Description:
Fires before creating a new post object. It is for Post/Product and CPT forms only.
Parameters:
  • $form_id:  (String) Form ID from Form setting.
  • $post_array: (Array) Processed form field array to insert post. Check 
    $postarr parameter of wp_insert_post function.

df_after_insert_post

do_action( 'df_after_insert_post', $form_id, $post_id, $post_array )

Description:
Fires after a new post has been inserted or an existing post has been updated successfully.
Parameters:
  • $form_id:  (String) Form ID from Form setting.
  • $post_id:  (int) ID of post inserted or updated. 
  • post_array:  (Array) An array of elements that made up a post to update or insert.

df_before_insert_user

do_action( 'df_before_insert_user', $form_id, $post_array )

Description:
Fires before creating a new post object. It is for Post/Product and CPT forms.
Parameters:
  • $form_id:  (String) Form ID from Form setting.
  • post_array:   (Array) An Array of user data arguments. Check $userdata parameter of wp_insert_user function.

df_after_insert_user

do_action( 'df_after_insert_user', $form_id, $user_id, $post_array )

Description:
Fires after a new user has been inserted or an existing user has updated successfully.

Parameters:
  • $form_id: (String) Form ID from Form setting.
  • $user_id: (int) ID of user inserted or updated. 
  • $post_array: (Array) An array of user data to update or insert.
Note: user_pass value of the array is the raw value for insert user form. But it is an encrypted value for edit user form.

df_process_uploaded_files

do_action( 'df_process_uploaded_files', $form_id,  $uploaded_files,  $form_type )

Description:
Fires after all files are uploaded via form.

Parameters:
  • $form_id: (String) Form ID from Form setting.
  • $uploaded_files: (Array) An array of the URL of uploaded files.
  • $form_type: (String) Type of the form.

df_after_process

do_action( 'df_after_process', $form_id, $post_array, $form_type )

Description:
Fires after captcha is checked as good and form submission is processed.

Parameters:
  • $form_id: (String) Form ID from Form setting.
  • $post_array:  (Array) An array of the parameters.
  • $form_type: (String) Type of the form.

df_captcha_failed

do_action( 'df_captcha_failed', $form_id, $post_array, $form_type )

Description:
Fires when captcha checking is failed.

Parameters:

  • $form_id: (String) Form ID from Form setting.
  • $post_array:  (Array) An array of the parameters.
  • $form_type: (String) Type of the form.

df_before_redirect

do_action( 'df_before_redirect', $form_id, $submit_result, $redirect_url )

Description:
Fires before page is redirecting after form submission is processed.

Parameters:

  • $form_id: (String) Form ID from Form setting.
  • $submit_result:  (String) β€˜success’ when the form is processed successfully, β€˜failed’ when there is an error on form submission.
  • $redirect_url : (String) Url to redirect after successed or failed.

de_fb_before_form_render

do_action( 'de_fb_before_form_render' )

Description:
Fires before form is rendered.

Parameters:

None


Filters


df_contact_body

apply_filters( 'df_contact_body', $body, $post_array )Description:

Description:
Filters the mail content to send.

Parameters:

  • $body: ((String) HTML string that has been generated to send.
  • $post_array:  (Array) An array of the parameters.

More Support?

Please email us at [email protected] if you are unable to get our hooks working.


Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.