Any suggestions on how to build a custom merge tag for this?
"yymmdd" is the most versatile save format.
Any suggestions on how to build a custom merge tag for this?
"yymmdd" is the most versatile save format.
How are you capturing your data, and how would you use this merge tag?
There is a gform_merge_tag_filter which may help, but right now I'm not sure what you need to do to know if this is going to work for you or not.
http://www.gravityhelp.com/documentation/page/Gform_merge_tag_filter
I'm using Gravity Forms on a form to capture a hidden date field (current date). Inside the default value I would like to put a merge tag. I want the output to be yymmdd.
This is because it's getting passed to a custom post type's, custom field. I used Advanced Custom Fields for this.
The default save format of ACF is yymmdd, and I would like to keep it in the database that way as well.
Sorry I'm a bit of a novice. I know this can be accomplished relatively easily, probably a hook or something right?
add_action("gform_pre_submission_7", "pre_submission_handler");
function pre_submission_handler($form){
$date1 = $_POST["input_3"];
$date1 = str_replace('/', '-', $date1);
$date1 = date("Ymd", strtotime($date1));
$date2 = $_POST["input_5"];
$date2 = date("Ymd", strtotime($date2));
$_POST["input_3"] = $date1;
$_POST["input_5"] = $date2;
}
Got it.
Thank you for the update.