Skip Navigation

[Resolved] Set CPT exiration date to auto archive

This support ticket is created 2 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
- 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: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by fleurP 2 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#2149343

I would like to add a date field to my CPT which will action the post to archive instead of auto archiving as per default WordPress settings. Is it possible to designate the folder it archives to?

#2150207

Hello,

Please elaborate the questions with more details:
Is it possible to designate the folder it archives to?

What folder are we talking about? How do you want the post be archived?

Toolset Forms plugin provides "Post Expiration" feature, and you can setup the Expiration date in WP admin side or frontend with post forms, after post expired, the post status will be changed, see our document:
https://toolset.com/course-lesson/setting-up-automatic-post-expiration/

#2150317

Morning, I would like to have the option to choose a folder/category already created to archive to. Reason being is that tender documents will be loaded that need to have a expiration date. They need to however for record keeping purposes still be available in future, hence the reson for the archive folder. Example would be to have a "Tenders 2021" category/folder and a "Tenders 2021 Archives" category / folder

#2150343

I assume you are going to add some specific taxonomy terms into the expired posts.

If it is, it needs custom codes, for example, after post is expired, you can use action hook "cred_post_expiration_custom_actions" to trigger a PHP function:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_post_expiration_custom_actions

In this PHP function, setup the taxonomy terms of the expired posts:
https://developer.wordpress.org/reference/functions/wp_set_object_terms/

#2155183

My issue is resolved now. Thank you!

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