Description

The wpforms_wp_footer_end action that is triggered at the end of the page load only if a form created with WPForms is found on the page and when all other scripts are loaded.

Parameters

This action does not accept any parameters.

More Information

This action will run at the end of the page load, but specifically for the wpforms_wp_footer_end action, it will only fire if there is a form created with WPForms found on that page and only when all other scripts are loaded.

This is especially useful if you have any custom JavaScript or custom CSS on the page but you don’t want that code to run if there isn’t a WPForms on the page.

Source

wpforms/src/Frontend/Frontend.php

Examples

This example is pulled from a snippet reference (link shown below) and it’s using Javascript and the wpforms_wp_footer_end action to disable the scroll animation on multi-page forms.

/**
 * Change the captcha theme for the Google Checkbox v2 reCAPTCHA
 *
 * @link https://wpforms.com/developers/how-to-change-the-captcha-theme-on-google-checkbox-v2-recaptcha/
 */
 
function wpf_dev_change_captcha_theme( ) {
?>

<script type="text/javascript">

    jQuery(function($){

        $( '.g-recaptcha' ).attr( 'data-theme', 'dark' );

    });

    </script>

<?php
}

add_action( 'wpforms_wp_footer_end', 'wpf_dev_change_captcha_theme', 30 );

Just one of the many ways to use the wpforms_wp_footer action on your site.

Reference Articles