Skip Navigation

[Resolved] How to duplicate the post

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

Problem:
How to duplicate the post

Solution:
when you navigate to:
=> Toolset => Post types => with each post type item you will see "Duplicate" link when you mouse hover on post type item.

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/i-would-like-to-change-the-url-structure-for-a-custom-post-type/#post-908857

Relevant Documentation:

This support ticket is created 6 years, 8 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
- 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)

Author
Posts
#899354

I used your plugin to create this form: hidden link which our grantees can fill out to create a page that looks like this: hidden link

I'm realizing now that we didn't "future proof" this because if the same grantee tries to submit a new report, there'll be no way based on the URL for us to distinguish which is the new report and which is the old one.

So, I was thinking it would be useful for us to insert the year in the URL structure like this: hidden link

I know how to do this for regular blog posts, but not for custom post types.

Thanks for any help you can offer!

#900291

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - I understand you want to change the post slug for the post you created using CRED form.

CRED offers hook cred_save_data using which you can update your post_name (slug).

More info:
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

Additionally, You need to set the rewrite option by edit your post type:
=> navigate to options section
=> with rewrite checkbox select option "Use a custom URL format" and add 2018
=> save your post type

Please check following screenshot:
=> hidden link

#905899
2018-05-29_174851.jpg

Hello Minesh. I was able to accomplish part of what I set out to do, but not all.

I was able to add the 2017 slug to all of the custom post types created in 2017. You can see an example here: hidden link

Now, we are of course in 2018 and I'd like to have our CRED form add 2018 to all new posts created. The thing is that if I change 2017 to 2018 in the options section it also changes all the 2017 posts over to ones with 2018.

Is there a way to keep all the 2017 post urls as they are and add the 2018 slug only to the new ones?

#906748

Hello,

I don't think there a better way for this, you might need to create anther post type, in option "Use a custom URL format" use 2018 as value.

#906938

Is there any way to duplicate my post type so that I don't have to go through all the steps of creating a new one. It's been a while since I created it and can't remember how I did it.

#908857

Minesh
Supporter

Languages: English (English )

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

Well - when you navigate to:
=> Toolset => Post types => with each post type item you will see "Duplicate" link when you mouse hover on post type item.

#908905

Thank you very much!