Home › Forums › General Issues › Publish / Expire posts based on ACF date picker field › Reply To: Publish / Expire posts based on ACF date picker field
Cheers for this code, worked for my needs except for the
$date_default_timezone_set
it was throwing an error when the cron ran saying the variable wasn’t defined. My needs aren’t that time critical, an around about that time/day will do so I just removed them both and all good.
Note that the second variable, in the above example for the expiring back to a draft is missing the $ at the start (wasn’t the cause of my error as I’m aware).
I was at a loss on what to do when clients will inadvertently set a publish date in the future, then hit the publish button and of course contact me asking why its already published. Figure I will hide the publish button with CSS and beef up the Save as Draft text link to be button looking, should do the trick I’m hoping
Thanks again for the post.
Mac
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.