Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Register Current Year Shortcode
// 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
You can’t perform that action at this time.