After seeing a plugin called CF Expiring Content Shortcode which allows you to hide certain parts of your posts at a set time, I wanted to take it a step further and include the ability to show certain parts of your posts after a set time also.
This function is extremely useful when working with competitions, where you have very specific times that content needs to appear or be hidden.
You could also use this when writing posts if you want to talk about information that’s included in a scheduled post that won’t be available when you first publish your post, so that you don’t have to remember to come back and modify the content after the scheduled post gets published.
Then, in order to use the shortcodes, wrap the text that you want to show or hide in the shortcodes like in the following examples:
Using the shortcodes
You can also use any PHP date or time string in your shortcodes, allowing you to specify exactly when the text is hidden or shown, to the nearest second (providing you’re not using a caching plugin). The date/time must be a valid date/time string in order for the shortcode to work.