Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * 3. Post Date
- *
- * This function produces the date the post in question was published.
- *
- * @example <code>[post_date]</code> is the default usage
- */
- if ( ! function_exists( 'woo_shortcode_post_date' ) ) {
- function woo_shortcode_post_date ( $atts ) {
- $defaults = array(
- 'format' => get_option( 'date_format' ),
- 'before' => '',
- 'after' => '',
- 'label' => ''
- );
- $atts = shortcode_atts( $defaults, $atts );
- $atts = array_map( 'wp_kses_post', $atts );
- $output = sprintf( '<abbr class="date time published updated" title="%5$s">%1$s%3$s%4$s%2$s</abbr> ', $atts['before'], $atts['after'], $atts['label'], get_the_time($atts['format']), get_the_time('Y-m-d\TH:i:sO') );
- return apply_filters( 'woo_shortcode_post_date', $output, $atts );
- } // End woo_shortcode_post_date()
- }
- add_shortcode( 'post_date', 'woo_shortcode_post_date' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement