Is there a way to only do a section of code on a template if the post has just been published or updated?
So for instance, I only want to do this ONCE:
$company = get_field('company_name');
$address = get_field('address');
$city = get_field('city');
$post_code = get_field('post_code');
When a post is published or updated. What do I need to wrap around that code?