Home › Forums › General Issues › Automatically add 7 days to Date Time Picker › Reply To: Automatically add 7 days to Date Time Picker
You would need to set up a cron to do this. https://codex.wordpress.org/Function_Reference/wp_cron
I would suggest a cron on the server set in your site control panel rather than a cron in WP because you will need to do a query to get all the posts that might have the date field, loop through all of the posts, get the date field for each post, check to see if it has passed and if it has update the field.
On a site with only a few post that need to be looked at using WP to do the cron will probably work. But if you have a lot of posts it will slow your site down and may even time out page loads.
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.