Plugin Author
Phil
(@philsbury)
Hi @soloant, which field are you doing it in? If it’s the Additional Content that allows shortcodes so you could create a super simple one like
add_shortcode('year', fn() => date('Y'));
Then just add [year] to the box?
If it’s another field, that’ll need a bit more thought (from me!)
Thanks
Phil
Hi, yes, in the Additional Content area. Apologies for not being more specific there.
I want to add this “Β© {echo:date(‘Y’)} BrandNameHere. All Rights Reserved.” so when a new year rolls around I’m not having to go in and update the date within the age-gate additional content area, I’d like it to update automatically.
I tried adding that little snippet a couple of different ways to that area but it just returned the copy/pasted text so I’m not doing something right. See here https://www.dropbox.com/scl/fi/mo2yxmt54458dfgfphq9m/CleanShot-2024-02-05-at-14.22.13-2x.png?rlkey=7ailhf4kn2o2xinjgza0ferzd&dl=0
Thanks,
Plugin Author
Phil
(@philsbury)
So add this to your functions:
add_shortcode('year', fn() => date('Y'));
Of if you are on less that PHP 7.4 use:
add_shortcode('year', function() {
return date('Y');
});
Then put Β© [year] BrandNameHere. All Rights Reserved. in the options box
Thanks
Phil
Aweee, thank you so much, got it working now.
Much appreciated. π