Skip Navigation

[Resolved] Automatic Child Post Expiration within a Many-to-Many Relationship

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

Problem:

I'm trying to get the events to auto-expire and remove themselves from the locations page using CRED.

Unfortunately, I can't get the post type Events to auto expire. If I set the expiration date on the event, it changes itself to a draft, but still displays on the front end. I can only get it to expire if I set it to auto-expire in the Intermediary post type, but that would require finding every event-location combination and setting each one to expire individually.

Is there any way to get one post type to expire from another when they're in a many-to-many relationship?

Solution:

There isn't such a built-in feature within CRED that:
get one post type to expire from another when they're in a many-to-many relationship

According to our document:
https://toolset.com/documentation/user-guides/automatic-post-expiration/
If you setup the "auto-expire" in the posts of Intermediary post type, CRED plugin will only change the post status of posts of Intermediary post type, it can not change the status of of other posts.

For the problem you mentioned above:
If I set the expiration date on the event, it changes itself to a draft, but still displays on the front end
You can create a view list "event" posts, filter by post status = "publish", then it should not output posts in "draft" status.
see our document:
https://toolset.com/documentation/user-guides/filtering-views-query-by-post-status/

Relevant Documentation:

https://toolset.com/documentation/user-guides/automatic-post-expiration/

This support ticket is created 6 years, 1 month 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 3 replies, has 2 voices.

Last updated by Luo Yang 6 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#619844

I have a post type (events) that is displayed on another post type (locations) using a many-to-many relationship (intermediary). This way I can have 1 event display on many locations, or from each location, set which events to display.

I'm trying to get the events to auto-expire and remove themselves from the locations page using CRED, following this page: https://toolset.com/forums/topic/having-an-expiration-date-on-a-child-post/

Unfortunately, I can't get the post type Events to auto expire. If I set the expiration date on the event, it changes itself to a draft, but still displays on the front end. I can only get it to expire if I set it to auto-expire in the Intermediary post type, but that would require finding every event-location combination and setting each one to expire individually.

Is there any way to get one post type to expire from another when they're in a many-to-many relationship?

#619881

Hi,

There isn't such a built-in feature within CRED that:
get one post type to expire from another when they're in a many-to-many relationship

According to our document:
https://toolset.com/documentation/user-guides/automatic-post-expiration/
If you setup the "auto-expire" in the posts of Intermediary post type, CRED plugin will only change the post status of posts of Intermediary post type, it can not change the status of of other posts.

For the problem you mentioned above:
If I set the expiration date on the event, it changes itself to a draft, but still displays on the front end
You can create a view list "event" posts, filter by post status = "publish", then it should not output posts in "draft" status.
see our document:
https://toolset.com/documentation/user-guides/filtering-views-query-by-post-status/

#620197

Ah, I was afraid of that. Unfortunately it's just going to have to be a somewhat manual process to expire these events. Thanks for your help Luo!

#620314

You are welcome

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