Skip Navigation

[Resolved] In custom field repeatable group, insert a time stamp automatically.

This support ticket is created 4 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by WeiS2074 4 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1649107

Hi,
In the custom field repeatable group, there are 2 fields, a radio button which has 2 options, a Date field. Can a user select the radio button, at the same time Toolset automatically insert a current date-time without user interaction? Or is it any other design having the same approach?

#1649199

Hello, there's nothing that will do this automatically for you but some custom code can achieve the same effect. If the post is created using Forms, the Forms API cred_save_data can be used to automatically set some value when the post is created or updated. If the post is created in wp-admin, the WordPress API save_post can be used to hook into the post save action. Then a custom field value can be created automatically when the post is saved.

We have information about the cred_save_data API available here: https://toolset.com/documentation/programmer-reference/cred-api/
Information about the WordPress save_post API is available here: https://developer.wordpress.org/reference/hooks/save_post/

Another ticket in the forum about a similar request: https://toolset.com/forums/topic/automatic-filling-date-fields/#post-1251117

Let me know if you have questions about this.

#1651201

My issue is resolved now. Thank you!