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

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

**Excerpt:** The wpforms_display_submit_after  action fires just after the submit button element is displayed.


**Content:**

## Description

The `wpforms_display_submit_after` action fires just after the submit button element is displayed.

## Parameters

$form\_data*(array)* Processed form settings/data, prepared to be used later.$button*(string)* Button type, e.g. `submit`, `next`.## Source

`wpforms/src/Frontend/Frontend.php`

## More Information

The hook fires within the form’s submit button container div, after the submit button element is displayed.

As an example, you can use this hook to add HTML that’s output **after** the **Submit** button on the form.

As an alternative, you could use the [wpforms\_display\_submit\_before](https://wpforms.com/developers/wpforms_display_submit_before/ "The wpforms_display_submit_before filter") to display something **before** the **Submit** button.

The [wpforms\_display\_submit\_before](https://wpforms.com/developers/wpforms_display_submit_before/ "The wpforms_display_submit_before filter") only accepts one parameter, which is the **Submit** button. So therefore this particular hook would only be tied to the **Submit** button and not through the **Next** or **Previous** page buttons.

## Examples

In our example code snippet, we are going to be checking first to see if the form ID is equal to `5`. If it is, a link to a video will display just after 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 that check 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 just after the submit button element is displayed.
 *
 * @link  https://wpforms.com/developers/wpforms_display_submit_after/
 *
 * @param array  $form_data Form data and settings.
 * @param string $button    Button type, e.g. `submit`, `next`.
 */
function wpf_dev_display_submit_after( $form_data, $button ) {

	if ( $button !== 'submit' ) {
		return;
	}

	// Only run on my form with ID = 5
	if ( absint( $form_data['id'] ) !== 1145 ) {
		return;
	}

	// Display a link to a YouTube video after the submit button.
	_e( ' Click here for a special video announcement!.', 'plugin-domain' );

}

add_action( 'wpforms_display_submit_after', 'wpf_dev_display_submit_after', 10, 2 );
```

**Categories:** Actions Hooks

**Tags:** PHP

---

