I have a page that displays a random post every day. In order to change post every 24 hours I use
set_transient('totd_trans_post_id', $totd[0]->ID, (60*60*24));
What I’m wondering is this:
- Does the countdown (60*60*24) start as soon as I have inserted and saved the code?
- If yes: What happens if I let the code run for 23 hours, and then decide to “update” the code. Will the countdown restart?
- If no one visits the site for 48 hours, will the expiration still take place? Or does someone have to visit after 24 hours to “run” it?