Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gravity Wiz // Gravity Forms // Modify Date Format for Custom Field
<?php
/**
* Gravity Wiz // Gravity Forms // Modify Date Format for Custom Field
* http://graivtywiz.com/
*/
add_filter( 'gform_post_data', function( $data ) {
// Update both instances of "my_date_custom_field" to your custom field name.
// Update 'Y-m-d' to your desired date format.
$data['post_custom_fields']['my_date_custom_field'] = date( 'Y-m-d', strtotime( $data['post_custom_fields']['my_date_custom_field'] ) );
return $data;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.