A new snippet that allows you to show or hide content based on if the post was published in the last X days. The snippet defaults to last 7 days, however this can be configured in the function arguments.
How to use
If you are using Gutenberg, you can use a similar method to this post for creating and adding conditions to your blocks.
If you are using Oxygen Builder, you can use the condition builder and the PHP return value
option and passing the function name and number of days as the argument.
The code
There are two snippets here which are slightly modified. The first one works based on the post date, the second works based on an ACF date field.