Skip Navigation

[Résolu] If empty, update "end" date field automatically if "start date" has a value

This support ticket is created Il y a 7 années et 6 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Marqué : 

This topic contains 4 réponses, has 3 voix.

Last updated by Minesh Il y a 7 années et 5 mois.

Assisted by: Minesh.

Auteur
Publications
#451077

Hello,

I have 2 custom fields: start date and end date.

If "end date" is left empty, but "start date" has a value, I would like to copy "start date" inside "end date" automatically on post save.

Is there a snippet you could provide me with or a specific hook/function I can look into?

Thanks

#451285

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I would like to know you want to implement this function with the backend (admin) or using CRED form - Could you please confirm?

#451505

In the backend (only using Types, not CRED).

#451933

Dear Sanny,

I suggest you try with wordpresss action hook save_post:
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post
save_post is an action triggered whenever a post or page is created or updated

#452522

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.