Home › Forums › General Issues › Update a field 30 Days after › Reply To: Update a field 30 Days after
A cronjob based approach would be the best way, store the values in variables and change the variable with code executed by a cronjob, I found a quite extensive thread on Stackoverflow
To summarise it I quote one of the Threads in case it gets closed
[shortened quote] The script will only run if you have a cron-job or someone access the page. (and a cron job is basically the computer accessing the page at a specific time!)
If you want a variable dependant on time of day simply use a if statement
(pseudo code)
if(now() < $time){ $var = 1; }else{ $var = 2; }
This means that anyone who visits the page before $time gets $var1 and after gets $var2
You will also find an introduction to cronjobs here
The big question is if you are familiar with cron jobs and if your hosting environment allows them.
I hope this will put you on the right track!
Cheers
Johannes
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.