Created
January 6, 2020 23:59
-
-
Save corypina/3620fbe8dba3b38e49dbfcf4829fb70b to your computer and use it in GitHub Desktop.
Auto Year WordPress shortcode
This file contains hidden or 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
<?php | |
// Generates the current year, for use in copyright notices | |
// Call with [auto-year] | |
// e.g., © [auto-year] Your Name | |
add_shortcode('auto-year', function(){ | |
$year = date('Y'); | |
return $year; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment