Re-generate Expiry Date based on updated Published Date
-
Hi PublishPress,
Many thanks for creating this plugin! I’ve found it very useful so far.However, I do have a small obstacle I’m not quite sure how to overcome. I am using this plugin to automatically hide events (for which I use the default post type) after they have passed. I have set up posts to automatically enable expiry dates, with the default set to ‘+ 12 hours’. This way, I can automatically expire events/posts 12 hours after they have been published.
Additionally, I’ve setup the posts in a way that when I ‘schedule’ a post for a future date (which is the event date) they are still returned as post_status published, so I can display future posts on the site frontend.
The issue however, is that the expiry date for a post is only generated once, when I click ‘Add new post’. So when I update the post published date with a later/earlier date, it doesn’t update the expiry date. How can I make the expiry date update automatically (to +12hrs from publishing) when I update a post’s publishing date? I’m fine with adding a PHP-based solution as well.
Your help is greatly appreciated!
– Casper
- The topic ‘Re-generate Expiry Date based on updated Published Date’ is closed to new replies.