Dynamically Populate Unix Timestamp

Set a field’s dynamic population parameter to “timestamp” to populate the current Unix timestamp.

Read the Walkthrough

Code

Filename: gw-dyn-pop-unix-timestamp.php

<?php
/**
 * Gravity Wiz // Gravity Forms // Dynamically Populate Unix Timestamp
 * https://gravitywiz.com/use-gravity-forms-conditional-logic-with-dates/
 *
 * Set a field's dynamic population parameter to "timestamp" to populate the current Unix timestamp.
 */
add_filter( 'gform_field_value_timestamp', function ( $value ) {
	return time();
} );

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.