I'd like somer code that I can place in my functions.php
file that will only modify the specified custom post type.
I have already tried several plugins, but all of them have more features than I need. It's overkill to mess with things I don't want them to mess with.
Ideally, the code will:
- Set up a daily cron job for 00:00 (at night)
- Fire a custom function that queries the database for the custom post type and compares its publication date with current date.
- If the custom post type is older than 3 months (the custom function returns true), then it will call
wp_delete_post()
for the post's ID.
Unfortunately, I can't put it all together myself.
Is there a good (simple) plugin that does this? A code snippet you have off the top of your head?