Feature Request: Expiry Date
-
My client asked for a possibility to set an expiry date to the banner such that the banner automatically does not show up after such date. Would it be possible to code such option?
Unfortunately I couldn’t find an appropriate filter to change the banner text programmatically, so I created an JS based solution for now. For those who are interested in that solution:
-) create a custom JS within in the plugin’s settings:
const expirydate = new Date(”November 23 2021 03:30“);
-) enquee a custom JS in your child-theme which checks the date an removes the banner:const now = new Date(); window.onload=function() { if (expirydate < now{ document.getElementById('simple-banner').remove(); } }
By the way, thank you very much for this tiny and elegant plugin!
The page I need help with: [log in to see the link]
- The topic ‘Feature Request: Expiry Date’ is closed to new replies.