Home / Admin / Set Default Date for Date Picker
Duplicate Snippet

Embed Snippet on Your Site

Set Default Date for Date Picker

Sets a default date for your Date Picker form field.

100+
Code Preview
php
<?php
/**
 * Sets a default date for Date Picker
 *
 * @link https://wpforms.com/developers/how-to-set-a-default-date-for-your-date-picker-form-field/
 * 
 * For support, please visit: https://www.facebook.com/groups/wpformsvip
 */
function wpf_dev_date_picker_default() {
    ?>
 
    <script type="text/javascript">
 
        window.wpforms_datepicker = {
 
            defaultDate: "today",
            disableMobile: "true"
 
        }
 
    </script>
 
    <?php
}
 
add_action( 'wpforms_wp_footer_end', 'wpf_dev_date_picker_default', 30 );

Comments

Add a Comment