Skip Navigation

[Resolved] Automatic set draft status to post if custom date field is greater than today

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

Problem:
The user would like a form submitted content to expire.

Solution:
This is totally possible with Toolset Forms. Check the documentation article.

Relevant Documentation:
https://toolset.com/documentation/user-guides/front-end-forms/automatic-post-expiration/

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

This topic contains 2 replies, has 2 voices.

Last updated by William Locatelli 4 years, 8 months ago.

Assisted by: Jamal.

Author
Posts
#1561365

Hi,
there is a way to automatic set draft status to the post after a check/control of a custom date field that is greater than today?

I have a CPT Event with a end date. I would like to hide expired events in wordpress search.

Thanks
William

#1561511

Hello William! Thank you for contacting the Toolset support.

What you are trying to do is possible with Toolset plugins, but it depends on how you create these events.
If you are using Toolset Forms for event creation, you can use the expiration feature to change the status of the event based on a date custom field. Check this article https://toolset.com/documentation/user-guides/front-end-forms/automatic-post-expiration/

If you are not using Toolset Form and with the view using which you are displaying the events where you want to hide all past events based on the custom end date field. In that case, you can add a query filter to your view
If you are using something else(plugin, backend, etc.) for event creation you may need a custom code that will create a WordPress Cron Job and change the status of expired events.
https://developer.wordpress.org/plugins/cron/

I hope this answers your question. Let me know if you have any doubts.

#1565231

My issue is resolved now. Thank you!