Created
February 12, 2012 19:13
-
-
Save krogsgard/1810326 to your computer and use it in GitHub Desktop.
Uses the get_the_modified_time function to created a shortcode, just like the [entry-published] shortcode in Hybrid Core
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
add_shortcode( 'entry-modified', 'krogs_entry_modified_shortcode' ); | |
function krogs_entry_modified_shortcode( $attr ) { | |
$domain = hybrid_get_textdomain(); | |
$attr = shortcode_atts( array( 'before' => '', 'after' => '', 'format' => get_option( 'date_format' ) ), $attr ); | |
$modified = '<abbr class="modified" title="' . sprintf( get_the_modified_time( esc_attr__( 'l, F jS, Y, g:i a', $domain ) ) ) . '">' . sprintf( get_the_modified_time( $attr['format'] ) ) . '</abbr>'; | |
return $attr['before'] . $modified . $attr['after']; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment