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
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.
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!