[Resolved] synchronize one-to-one relationship post expiration date
This support ticket is created 4 years, 10 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I would like to to synchronize post expiration date. I have two post types, public listing and restricted listing. When a restricted listing goes draft(post expiration set by your form), I would like its child post Public List goes to draft too.
How can I do this?
Is there any documentation that you are following?
Our APIs don't include any events for when posts are expired, but you could use the standard WP hook save_post to check whether one of the restricted listing posts is being updated and to set the post status of the related public listing to have a matching status.
I'm not sure how your restricted and public listings are connected, but if it is via a Types relationship then you would need to use the API function toolset_get_related_post or toolset_get_related_posts to retrieve the ID of the public listing you need to update.
It is one-to-one relationship. I am not a coder (that is a point of using Toolset for me) so I don't know how to start.
Could you possibly provide a sample code or something??