Skip to content

Instantly share code, notes, and snippets.

@chrisdavidmiles
Created September 18, 2018 00:05
Show Gist options
  • Save chrisdavidmiles/a7c6a37ea3c1b4167cf05f1cc6ff73f3 to your computer and use it in GitHub Desktop.
Save chrisdavidmiles/a7c6a37ea3c1b4167cf05f1cc6ff73f3 to your computer and use it in GitHub Desktop.
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