Created
March 13, 2015 15:36
-
-
Save kjohnson/633849853cb89b2497ea to your computer and use it in GitHub Desktop.
Current Date Short Code
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 | |
/* | |
* Plugin Name: Current Date Short Code | |
*/ | |
function current_date_short_code_func($args) { | |
if ( ! isset( $args['format'] ) ) | |
{ | |
$args['format'] = 'm/d/Y'; | |
} | |
return date($args['format']); | |
} | |
add_shortcode('current_date', 'current_date_short_code_func'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment