# Form Hooks

`Action Hooks` `38 Hooks`

These hooks fire during form lifecycle events — creation, rendering, deletion, and display.

### `fluentform/after_all_forms_render`

**Description**

This action fires after all form page was rendered.

**Usage**

```php
add_action('fluentform/after_all_forms_render', function() {
   // Do your stuff here
}, 10, 0);
```

**Reference**

`do_action('fluentform/after_all_forms_render');`

This hook is located in `fluentform/app/Views/admin/all_forms.php`.

### `fluentform/after_documentation_wrapper`

**Description**

This action run after render support page documentation.

**Usage**

```php
add_action('fluentform/after_documentation_wrapper', function() {
   // Do your stuff here
}, 10, 0);
```

**Reference**

`do_action('fluentform/after_documentation_wrapper');`

This hook is located in `fluentform/app/Views/admin/docs/index.php`.

### `fluentform/after_form_delete`

**Parameters**

- `$formId` — see source

**Usage**

```php
add_action('fluentform/after_form_delete', function ($formId) {
    // your code
}, 10, 1);
```

**Reference**

`do_action('fluentform/after_form_delete', $formId);`

This action is located in `app/Models/Form.php` (line 286).

### `fluentform/after_form_entry_app`

**Parameters**

- `$form_id` — see source

**Usage**

```php
add_action('fluentform/after_form_entry_app', function ($form_id) {
    // your code
}, 10, 1);
```

**Reference**

`do_action('fluentform/after_form_entry_app', $form_id);`

This action is located in `app/Views/admin/form/entries.php` (line 14).

### `fluentform/after_form_menu`

**Parameters**

- See source

**Usage**

```php
add_action('fluentform/after_form_menu', function ($value) {
    // your code
}, 10, 1);
```

**Reference**

`do_action('fluentform/after_form_menu');`

This action is located in `app/Views/admin/form/form_wrapper.php` (line 95).

### `fluentform/after_form_navigation`

**Description**

This action runs after add navigation buttons to the admin page header.

**Parameters**

- `$form_id` (int) Form ID
- `$route` (string) Current Route

**Usage:**

```php
add_action('fluentform/after_form_navigation', function($form_id, $route) {
   // Do your stuff here
}, 10, 2);
```

**Reference**

`do_action('fluentform/after_form_navigation', $form_id, $route);`

This action is located in `fluentform/app/Views/admin/form/form_wrapper.php`

### `fluentform/after_form_navigation_{$route}`

**Description**

This action runs after add navigation buttons to the admin page header.

**Parameters**

- `$form_id` (int) Form ID

**Usage**

```php
add_action('fluentform/after_form_navigation_{$route}', function($form_id) {
   // Do your stuff here
}, 10, 1);
```
**Note:** `{$route}` is a dynamic route. Replace `{$route}` with Fluent Forms admin route key.

**Reference**

`do_action('fluentform/after_form_navigation_' . $route, $form_id);`

This action is located in `fluentform/app/Views/admin/form/form_wrapper.php`

### `fluentform/after_form_render`

**Description**

This action runs after the form rendering is completed. If you need to do anything in the background you can use this action.

**Parameters**
- `$form` (object) Form Object

**Usage**

```php
add_action('fluentform/after_form_render', function($form) {
   // Do your stuff here
}, 10, 1);
```

**Reference**

`do_action('fluentform/after_form_render', $form);`

This hook is located in `fluentform/app/Services/FormBuilder/FormBuilder.php`.

### `fluentform/after_form_reports_render`

**Parameters**

- See source

**Usage**

```php
add_action('fluentform/after_form_reports_render', function ($value) {
    // your code
}, 10, 1);
```

**Reference**

`do_action('fluentform/after_form_reports_render');`

This action is located in `app/Views/admin/reports/index.php` (line 20).

### `fluentform/after_form_screen_wrapper`

**Description**

This action runs after the fluent form editor wrapper in the admin panel. If you need to do anything in the background you can use this action.

**Parameters**
- `$form_id` (int) Form ID
- `$route` (string) Route

**Usage**

```php
add_action('fluentform/after_form_screen_wrapper', function($form_id, $route) {
   // Do your stuff here
}, 10, 2);
```

**Reference**

`do_action('fluentform/after_form_screen_wrapper', $form_id, $route);`

This hook is located in `fluentform/app/Views/admin/form/form_wrapper.php`.

### `fluentform/after_permission_set_assignment`

**Description**

This action runs after fluentform is assigned permission set to a role.

**Usage**

```php
add_action('fluentform/after_permission_set_assignment', function() {
   // Do your stuff here
}, 10, 0);
```

**Reference**

`do_action('fluentform/after_permission_set_assignment');`

This hook is located in fluentform/app/Modules/Acl/Acl.php

### `fluentform/before_all_forms_render`

**Description**

This action fires before the all form page is rendering.

**Usage**

```php
add_action('fluentform/before_all_forms_render', function() {
   // Do your stuff here
}, 10, 0);
```

**Reference**

`do_action('fluentform/before_all_forms_render');`

This hook is located in `fluentform/app/Views/admin/all_forms.php`.

### `fluentform/before_documentation_wrapper`

**Description**

This action run before render support page documentation.

**Usage**

```php
add_action('fluentform/before_documentation_wrapper', function() {
   // Do your stuff here
}, 10, 0);
```

**Reference**

`do_action('fluentform/before_documentation_wrapper');`

This hook is located in `fluentform/app/Views/admin/docs/index.php`.

### `fluentform/before_form_delete`

**Parameters**

- `$formId` — see source

**Usage**

```php
add_action('fluentform/before_form_delete', function ($formId) {
    // your code
}, 10, 1);
```

**Reference**

`do_action('fluentform/before_form_delete', $formId);`

This action is located in `app/Models/Form.php` (line 263).

### `fluentform/before_form_entry_app`

**Parameters**

- `$form_id` — see source

**Usage**

```php
add_action('fluentform/before_form_entry_app', function ($form_id) {
    // your code
}, 10, 1);
```

**Reference**

`do_action('fluentform/before_form_entry_app', $form_id);`

This action is located in `app/Views/admin/form/entries.php` (line 5).

### `fluentform/before_form_render`

**Description**

This action fires right before the form is rendered. If you want to do certain task after a form rendering then you can catch this action hook and do your staff.

**Parameters**
- `$form` (object) Form Object

**Usage**

```php
add_action('fluentform/before_form_render', function($form) {
   // Do your stuff here
}, 10, 1);
```

**Reference**

`do_action('fluentform/before_form_render', $form);`

This hook is located in `fluentform/app/Services/FormBuilder/FormBuilder.php`.

### `fluentform/before_form_reports_render`

**Parameters**

- See source

**Usage**

```php
add_action('fluentform/before_form_reports_render', function ($value) {
    // your code
}, 10, 1);
```

**Reference**

`do_action('fluentform/before_form_reports_render');`

This action is located in `app/Views/admin/reports/index.php` (line 11).

### `fluentform/before_form_screen_wrapper`

**Description**

This action runs after the fluent form editor wrapper in the admin panel. If you need to do anything in the background you can use this action.

**Parameters**
- `$form_id` (int) Form ID
- `$route` (string) Route

**Usage**

```php
add_action('fluentform/before_form_screen_wrapper', function($form_id, $route) {
   // Do your stuff here
}, 10, 2);
```

**Reference**

`do_action('fluentform/before_form_screen_wrapper', $form_id, $route);`

This hook is located in `fluentform/app/Views/admin/form/form_wrapper.php`.

### `fluentform/before_form_validation`

**Parameters**

- `$fields` — see source
- `$formData` — see source

**Usage**

```php
add_action('fluentform/before_form_validation', function ($fields, $formData) {
    // your code
}, 10, 2);
```

**Reference**

`do_action('fluentform/before_form_validation', $fields, $formData);`

This action is located in `app/Services/Form/FormValidationService.php` (line 48).

### `fluentform/before_permission_set_assignment`

**Description**

This action runs before fluentform is going to assign permission set to a role.

**Usage**

```php
add_action('fluentform/before_permission_set_assignment', function() {
   // Do your stuff here
}, 10, 0);
```

**Reference**

`do_action('fluentform/before_permission_set_assignment');`

This hook is located in fluentform/app/Modules/Acl/Acl.php

### `fluentform/before_updating_form`

**Parameters**

- `$form` — see source
- `$data` — see source

**Usage**

```php
add_action('fluentform/before_updating_form', function ($form, $data) {
    // your code
}, 10, 2);
```

**Reference**

`do_action('fluentform/before_updating_form', $form, $data);`

This action is located in `app/Services/Form/Updater.php` (line 57).

### `fluentform/editor_script_loaded`

**Parameters**

- `$form` — see source

**Usage**

```php
add_action('fluentform/editor_script_loaded', function ($form) {
    // your code
}, 10, 1);
```

**Reference**

`do_action('fluentform/editor_script_loaded', $form);`

This action is located in `app/Modules/Registerer/Menu.php` (line 1069).

### `fluentform/form_application_view_{$route}`

**Description**

This action runs admin page view. You can hook into it and run your script depending on the current route and form ID.

**Parameters**

- `$form_id` (int) Form ID

**Usage:**

```php
add_action('fluentform/form_application_view_{$route}', function($form_id) {
   // Do your stuff here
}, 10, 2);
```
**Note:** `{$route}` is a dynamic route. Replace `{$route}` with Fluent Forms admin route key.

**Reference**

`do_action('fluentform/form_application_view_' . $route, $form_id);`

This action is located in `fluentform/app/Views/admin/form/form_wrapper.php`

### `fluentform/form_duplicated`

**Description**

After a form is duplicated this action is fired.

**parameters**
- `$newFormId` (int) Form Id

**Usage:**
```php
add_action('fluentform/form_duplicated', function($form$newFormId) {
   // Do your stuff when form is duplicated
}, 10, 1);
```

**Reference**

`do_action('fluentform/form_duplicated', $form->id);`

This action is located in `fluentform/app/Services/Form/FormService.php`

### `fluentform/form_element_start`

**Description**

This action runs before rendering the input elements of the form. If you need to do anything in the background you can use this action.

**parameters**
- `$form` (object) Form Object

**Usage:**
```php
add_action('fluentform/form_element_start', function($formId, $data) {
   // Do your stuff when form element start
}, 10, 1);
```

**Reference**

`do_action('fluentform/form_element_start', $form);`

This action is located in `fluentform/app/Services/FormBuilder/FormBuilder.php -> build()`

### `fluentform/form_imported`

**Description**

This action is fired after a form is imported. So you can use this hook and run your script after a form is imported

**Parameters**
- `$form_id` (int) Form ID

**Usage**

```php
add_action('fluentform/form_imported', function($form_id) {
   // Do your stuff here
}, 10, 1);
```

**Reference**

`do_action('fluentform/form_imported', $formId);`

This hook is located in `fluentform/app/Services/Form/FormService.php`.

### `fluentform/inserted_new_form`

**Description**

This action fires after the new form is created. If you want to do certain task after a form creation then you can catch this action hook and do your staff.

**parameters**
- `$formId` (int) Form Id
- `$data` (array) Form Data

**Usage:**
```php
add_action('fluentform/inserted_new_form', function($formId, $data) {
   // Do your stuff when form is created
}, 10, 2);
```

**Reference**

`do_action('fluentform/inserted_new_form', $form->id, $data);`

This action is located in `fluentform/app/Services/Form/FormService.php`

### `fluentform/load_form_assets`

**Description**

This action fires when loading the form asset.

**Parameters**
- `$formId`  (int)  Form Id

**Usage:**
```php
add_action('fluentform/load_form_assets', function($formId) {
   // Do your stuff when load form assets
}, 10, 1);
```

**Reference**

`do_action('fluentform/load_form_assets', $formId);`

This action is located in `fluentform/app/Modules/Widgets/OxygenWidget.php`, `fluentformpro/src/classes/SharePage/SharePage.php`, `fluentform/app/Hooks/actions.php`.

### `fluentform/render_item_{$item_element}`

**Description**

This action runs every time an input item is rendered. If you need to do anything in the background you can use this action. $item is the key of the component that is being rendered.

**Parameters**
- `$item` (array) Input Element
- `$form` (object) Form Object

**Usage**

```php
add_action('fluentform/render_item_{$item_element}', function($item, $form) {
   // Do your stuff here
}, 10, 2);
```

**Note:** `{$item_element}` is dynamic field element name. Replace `{$item_element}` with valid Fluent Forms field element name.

**Reference**

`do_action('fluentform/render_item_' . $item['element'], $item, $form);`

This hook is located in `fluentform/app/Modules/Component/Component.php`.

### `fluentform/render_item_step_end`

**Parameters**

- `$form` — see source
- `$form_2` — see source

**Usage**

```php
add_action('fluentform/render_item_step_end', function ($form, $form_2) {
    // your code
}, 10, 2);
```

**Reference**

`do_action('fluentform/render_item_step_end', $form->fields['stepsWrapper']['stepEnd'], $form);`

This action is located in `app/Services/FormBuilder/FormBuilder.php` (line 285).

### `fluentform/render_item_step_start`

**Parameters**

- `$startElement` — see source
- `$form` — see source

**Usage**

```php
add_action('fluentform/render_item_step_start', function ($startElement, $form) {
    // your code
}, 10, 2);
```

**Reference**

`do_action('fluentform/render_item_step_start', $startElement, $form);`

This action is located in `app/Services/FormBuilder/FormBuilder.php` (line 330).

### `fluentform/render_item_submit_button`

**Description**

This action runs every time when submit button is rendered. If you need to do anything in the background you can use this action.

**Parameters**
- `$submitButton` (array) Input Element
- `$form` (object) Form Object

**Usage**

```php
add_action('fluentform/render_item_submit_button', function($submitButton, $form) {
   // Do your stuff here
}, 10, 2);
```

**Reference**

`do_action('fluentform/render_item_submit_button', $form->fields['submitButton'], $form);`

This hook is located in `fluentform/app/Modules/Component/Component.php`.

### `fluentform/rendering_address_field`

**Description**

This action run when render address field.

**Parameters**
- `$field` (array) Field Data
- `$form` (object) Form Object

**Usage**

```php
add_action('fluentform/rendering_address_field', function($field, $form) {
   // Do your stuff here
}, 10, 2);
```

**Reference**

`do_action('fluentform/rendering_address_field', $data, $form);`

This hook is located in `fluentform/app/Services/FormBuilder/Components/Address.php -> compile()`.

### `fluentform/rendering_calculation_form`

**Description**

This action runs if the form input has calculation in it and during rendering the input . If you need to do anything in the background you can use this action.

**Parameters**
- `$form` (object) Form
- `$field` (array) Input Element

**Usage**

```php
add_action('fluentform/rendering_calculation_form', function($form, $field) {
   // Do your stuff here
}, 10, 2);
```

**Reference**

`do_action('fluentform/rendering_calculation_form', $form, $field);`

This hook is located in `fluentform/app/Services/FluentConversational/Classes/Converter/Converter.php`, `fluentfomr/app/Services/FormBuilder/Components/Text.php`.

### `fluentform/spam_attempt_caught`

**Description**

This action is triggered when a spam attempt is caught. You can use this to log spam attempts, notify administrators, or implement additional security measures.

**Parameters**

`$reason` (string) The reason for the spam detection

**Usage**

```php
add_action('fluentform/spam_attempt_caught', function ($reason) {
    // Log spam attempt
    error_log("Spam attempt caught: " . $reason);

    // Notify admin
    wp_mail('admin@example.com', 'Spam Attempt Detected', "A spam attempt was caught. Reason: " . $reason);
}, 10, 1);
```

**Reference**

`do_action('fluentform/spam_attempt_caught', $reason);`

This action is located in the `FluentForm\App\Modules\Form\TokenBasedSpamProtection -> handleSpam` method.

### `fluentform/starting_file_processing`

**Description**

This action run when processing uploaded file.

**Parameters**
- `$files` (array) Files
- `$uploadLocation` (string) Files Upload Location
- `$formData` (array) Submission Data
- `$form` (object) Form Object

**Usage**

```php
add_action('fluentform/starting_file_processing', function($files, $uploadLocation, $formData, $form) {
   // Do your stuff here
}, 10, 4);
```

**Reference**

`do_action('fluentform/starting_file_processing', $files, $uploadLocation, $formData, $form);`

This hook is located in `fluentformpro/src/Uploader.php -> processFiles()`.

### `fluentform/starting_file_upload`

**Description**

This action run before uploading a file.

**Parameters**
- `$files` (array) Files
- `$form` (object) Form Object

**Usage**

```php
add_action('fluentform/starting_file_upload', function($files, $form) {
   // Do your stuff here
}, 10, 2);
```

**Reference**

`do_action('fluentform/starting_file_upload', $files, $this->form);`

This hook is located in `fluentformpro/src/Uploader.php -> upload()`.

### `oxygen_add_plus_fluentform_form`

**Description**

This action runs when register Fluent Forms Oxygen widget sections.

**Usage:**
```php
add_action('oxygen_add_plus_fluentform_form', function() {
   // Do your stuff when register oxyget plus widget
}, 10, 0);
```

**Reference**

`do_action('oxygen_add_plus_fluentform_form');`

This action is located in `fluentform/app/Modules/Widgets/OxygenWidget.php`
