Last active
March 26, 2022 20:44
-
-
Save itsViney/679105ddfe8af076175992554b8935a4 to your computer and use it in GitHub Desktop.
Wordpress shortcode that returns the current year. For footer copyrights, mostly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Basic shortcode to return the current year (for copyright line) | |
Example: © [year] itsViney | |
*/ | |
function currentYear($atts) | |
{ | |
return date('Y'); | |
} | |
add_shortcode('year', 'currentYear'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment