Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Created March 13, 2015 15:36
Show Gist options
  • Save kjohnson/633849853cb89b2497ea to your computer and use it in GitHub Desktop.
Save kjohnson/633849853cb89b2497ea to your computer and use it in GitHub Desktop.
Current Date Short Code
<?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