### [wpforms_display_submit_before](https://wpforms.com/developers/wpforms_display_submit_before/)

**Published:** February 18, 2020
**Author:** Editorial Team

**Excerpt:** The wpforms_display_submit_before  action fires immediately before the submit button element is displayed.


**Content:**

## Description

The `wpforms_display_submit_before` action fires immediately before the submit button element is displayed.

## Parameters

$form\_data*(array)* Processed form settings/data, prepared to be used later.## Source

`wpforms/src/Frontend/Frontend.php`

## More Information

The action fires within the form’s submit button container div, just before the submit button element.

For example, you can use this hook to add HTML output **before** the submit button.

As an alternative, you could use the [wpforms\_display\_submit\_after](https://wpforms.com/developers/wpforms_display_submit_after/ "The wpforms_display_submit_after filter") to display something **after** the **Submit** button on the form.

## Examples

In our example code snippet, we will be checking first to see if the form ID is equal to `5`. If it is, a link to a video will display just before the form’s **Submit** button.

Just remember to change the form ID from `5` to match the specific form ID you’re wanting to run your code on. Removing this line of the code would run for all forms.

If you need assistance in finding your form ID, [you can review this tutorial](https://wpforms.com/developers/how-to-locate-form-id-and-field-id/ "How to Locate Form ID and Field ID").

```

/**
 * Action that fires immediately before the submit button element is displayed.
 * 
 * @link  https://wpforms.com/developers/wpforms_display_submit_before/
 * 
 * @param array  $form_data Form data and settings
 */

function wpf_dev_display_submit_before( $form_data ) {
 
    // Only run on my form with ID = 5
    if ( absint( $form_data[ 'id' ] ) !== 5 ) {
            return;
        } 
 		
    // Run code or see example echo statement below.
    _e( ' Click here for a special video announcement!.', 'plugin-domain' );

}
add_action( 'wpforms_display_submit_before', 'wpf_dev_display_submit_before', 10, 1 );
```

**Categories:** Actions Hooks

**Tags:** PHP

---

