Skip to content

Instantly share code, notes, and snippets.

@bluedognz
Created July 2, 2018 11:04
Show Gist options
  • Save bluedognz/d9573f47ddb6e41e9df6f65f3109fbb5 to your computer and use it in GitHub Desktop.
Save bluedognz/d9573f47ddb6e41e9df6f65f3109fbb5 to your computer and use it in GitHub Desktop.
[c] [y] shortcode returns copyright symbol and current year
/**
* [y] Shortcode
* @return string Current Year in 4 digits
*/
function bdw_current_year() {
$date = getdate();
return $date['year'];
}
add_shortcode( 'y', 'bdw_current_year' );
/**
* [c] Shortcode
* @return string Copyright symbol
*/
function bdw_copyright() {
return '©';
}
add_shortcode( 'c', 'bdw_copyright' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment