Skip Navigation

[Resolved] Duplicate event with new start- and end date

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user would like to implement a duplicate form where he can customize some fields.

Solution:
This is possible with custom code. The idea is to create a new create event form, that will include "startdate", "enddate", and "submit" form fields, then hook into the submission and copy all other fields from the original event. You can check a similar case, that copies all fields, here https://toolset.com/forums/topic/front-end-user-duplicate-post-function/#post-281290

You can either hook into "cred_before_save_data" which happens before saving the new post or into "cred_save_data" which happens after saving the new post.

Relevant Documentation:
- https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-creating-content/
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_before_save_data
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

This support ticket is created 4 years, 7 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9: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: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by charlotteM-2 4 years, 7 months ago.

Assisted by: Jamal.

Author
Posts
#1572981

Tell us what you are trying to do?
Trying to let registered users duplicate an already made event, while being able to edit the start- and enddate and time.

Is there any documentation that you are following?
I tried to find documentation on this, but could not find. Also I searched the forum, but that is also no help.

Is there a similar example that we can see?
The page is a restricted page. I copied and translated an example of what I mean:

START DATE TRAINING / ACTIVITY ON THE SITE
January 30, 2020 Mindfulness training individually in Rotterdam South by Charlotte Maas
Edit | remove
September 6, 2019 Introduction to Mindfulness in Rotterdam by Charlotte Maas
Edit | remove
September 6, 2019 Mindful walking: "walk with me" in Rotterdam
Edit | remove

On the line 'edit | remove' I want to add 'duplicate'.

What is the link to your site?
hidden link

#1573107

Hello and thank you for contacting the Toolset support.

This is possible with custom code. The idea is to create a new create event form, that will include "startdate", "enddate", and "submit" form fields, then hook into the submission and copy all other fields from the original event. You can check a similar case, that copies all fields, here https://toolset.com/forums/topic/front-end-user-duplicate-post-function/#post-281290

You can either hook into "cred_before_save_data" which happens before saving the new post or into "cred_save_data" which happens after saving the new post.

Check this documentation articles:
- https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-creating-content/
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_before_save_data
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

I hope this helps. Let me know if you have any doubts.

#1575187

My issue is resolved now. Thank you!