Tell us what you are trying to do?
We have created a Toolset Post Type for Students and are attempting to post to it from a Gravity form "Add Student Information" form. It uses the Gravity Forms Advanced Post Creation Add-On to populate data in a "Students" custom post type record. Everything on the form posts correctly except for the 7 Date fields.
Gravity Forms stores dates in MYSQL format e.g. 2022-12-10 and Toolset custom post type Date fields appear to store dates in Unix Timestamp format e.g. 1234567890. We are using the Date field types in both the Gravity Forms form fields and the Custom Post Type fields.
How can we convert the date in the Date fields from the Gravity Forms format (yyyy-mm-dd) so that it will post correctly in the Toolset Custom Post Type in Unix timestamp format?
Thanks so much for your help with this. We think Toolset should give us the custom reporting that our client needs. However, this has us stopped until it can be resolved.
Thank you for your help with this.
Mike
Is there any documentation that you are following?
I've looked at all the relevant docs on your site and done extensive Googling on the issue. No luck.
Is there a similar example that we can see?
I've uploaded an export of the Gravity Form that won't post to Toolset Types. It can be downloaded at: hidden link
I think the solution you will need to implement would use the Gravity Forms API to hook into the form submission process, once the submitted post has been saved, and take the dates submitted with the form and convert them to timestamps, then overwrite the saved date fields with the timestamps.
I have been able to convert the date on a Gravity Forms Add form to a Unix Timestamp and it now correctly posts that date to a Toolset custom post type date field. Everything looks good in the CPT record and we can display the date in a Toolset View.
However, I still cannot get the Student custom post to display at all in a Gravity Forms Edit form. If I go to my WordPress admin page for Student custom posts and manually refresh the post after I first add it, it then correctly displays in the GF Edit form.
My next step is to try using the GF hook, gform_advancedpostcreation_post_after_creation (hidden link) and/or the Gravity Wiz GW_Update_Posts snippet to see if I can get the post to auto-refresh itself immediately after the Add form is submitted. I will be working on it this evening and tomorrow.
Nothing that I can think of Toolset related that can help on that matter, but if by updating the post it is fixed what about using the native WordPress save_post hook to force an update programmatically?