I want an email to be sent to a specific list of email addresses if/when there have been no posts on the blog within the past 1 week. Any ideas on how I could do this?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
You'll need to set up a cron job that checks once a day to see if the latest post is more than seven days old. So, some where in a plugin file. Schedule a new event. Then hook into that event. Grab the post date, turn it into a unix time stamp, and compare that with the current time.
As a plugin: https://gist.github.com/1246814 Alternatively, you could use DateTime objects to do the time comparison or just use this plugin (but it's way more fun to figure it out yourself, just sayin'). |
|||||||||||
|