Skip to content

Instantly share code, notes, and snippets.

@FriendlyWP
Created October 26, 2013 00:54
Show Gist options
  • Save FriendlyWP/7164021 to your computer and use it in GitHub Desktop.
Save FriendlyWP/7164021 to your computer and use it in GitHub Desktop.
Shortcode to insert current year.
/* SHORTCODE WHICH INSERTS CURRENT YEAR
* usage: [year]
*/
add_shortcode('year', 'year_shortcode');
function year_shortcode() {
$year = date('Y');
return $year;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment