Created
May 16, 2019 20:41
-
-
Save Edwardtonnn/3aaca8ce91e6a7c67df60f906cd6f319 to your computer and use it in GitHub Desktop.
WP 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
<?php | |
function currentYear( $atts ){ | |
return date('Y'); | |
} | |
add_shortcode( 'year', 'currentYear' ); | |
//To use the shortcode | |
[year] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment