Why am I getting a “Call to member function format() on a non-object” error?
“Call to member function format() on a non-object” means that $formatted_date is not an object. Why do you need 2 functions for this? Can’t you just check the post meta for your custom field in the save routine? Especially with such a late priority the custom field should already be saved. function acf_set_expiry($post_id) { if … Read more