Gravity Wiz // Gravity Forms // Modify Date Format for Custom Field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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