Populate Date One Year from Current Date

Read the Walkthrough

Code

Filename: gw-populate-date-year-from-today.php

<?php
/**
 ** Gravity Wiz // Gravity Forms // Populate Date One Year from Current Date
 * https://gravitywiz.com/populate-date-one-year-from-current-date/
 *
 */
add_filter('gform_field_value_year_from_date', function() {
	return gmdate( 'Y-m-d', strtotime( '+1 year' ) );
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.