Created
September 18, 2018 00:05
-
-
Save chrisdavidmiles/a7c6a37ea3c1b4167cf05f1cc6ff73f3 to your computer and use it in GitHub Desktop.
Register Current Year Shortcode
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
// Register Current Year Shortcode (for use in footers and legal docs) | |
// [current-year] Ex: "2018" | |
function year_shortcode_func() { | |
$current_year = date('Y'); | |
return $current_year;} | |
add_shortcode('current-year', 'year_shortcode_func'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment