| @@ 10-42 (lines=33) @@ | ||
| 7 | * @package bitsy |
|
| 8 | */ |
|
| 9 | ||
| 10 | if ( ! function_exists( 'bitsy_posted_on' ) ) : |
|
| 11 | /** |
|
| 12 | * Prints HTML with meta information for the current post-date/time and author. |
|
| 13 | */ |
|
| 14 | function bitsy_posted_on() { |
|
| 15 | $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; |
|
| 16 | if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { |
|
| 17 | $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; |
|
| 18 | } |
|
| 19 | ||
| 20 | $time_string = sprintf( $time_string, |
|
| 21 | esc_attr( get_the_date( 'c' ) ), |
|
| 22 | esc_html( get_the_date() ), |
|
| 23 | esc_attr( get_the_modified_date( 'c' ) ), |
|
| 24 | esc_html( get_the_modified_date() ) |
|
| 25 | ); |
|
| 26 | ||
| 27 | $posted_on = sprintf( |
|
| 28 | /* translators: %s: post date. */ |
|
| 29 | esc_html_x( 'Posted on %s', 'post date', 'bitsy' ), |
|
| 30 | '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' |
|
| 31 | ); |
|
| 32 | ||
| 33 | $byline = sprintf( |
|
| 34 | /* translators: %s: post author. */ |
|
| 35 | esc_html_x( 'by %s', 'post author', 'bitsy' ), |
|
| 36 | '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>' |
|
| 37 | ); |
|
| 38 | ||
| 39 | echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK. |
|
| 40 | ||
| 41 | } |
|
| 42 | endif; |
|
| 43 | ||
| 44 | if ( ! function_exists( 'bitsy_entry_footer' ) ) : |
|
| 45 | /** |
|
| @@ 10-42 (lines=33) @@ | ||
| 7 | * @package _s |
|
| 8 | */ |
|
| 9 | ||
| 10 | if ( ! function_exists( '_s_posted_on' ) ) : |
|
| 11 | /** |
|
| 12 | * Prints HTML with meta information for the current post-date/time and author. |
|
| 13 | */ |
|
| 14 | function _s_posted_on() { |
|
| 15 | $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; |
|
| 16 | if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { |
|
| 17 | $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; |
|
| 18 | } |
|
| 19 | ||
| 20 | $time_string = sprintf( $time_string, |
|
| 21 | esc_attr( get_the_date( 'c' ) ), |
|
| 22 | esc_html( get_the_date() ), |
|
| 23 | esc_attr( get_the_modified_date( 'c' ) ), |
|
| 24 | esc_html( get_the_modified_date() ) |
|
| 25 | ); |
|
| 26 | ||
| 27 | $posted_on = sprintf( |
|
| 28 | /* translators: %s: post date. */ |
|
| 29 | esc_html_x( 'Posted on %s', 'post date', '_s' ), |
|
| 30 | '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' |
|
| 31 | ); |
|
| 32 | ||
| 33 | $byline = sprintf( |
|
| 34 | /* translators: %s: post author. */ |
|
| 35 | esc_html_x( 'by %s', 'post author', '_s' ), |
|
| 36 | '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>' |
|
| 37 | ); |
|
| 38 | ||
| 39 | echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK. |
|
| 40 | ||
| 41 | } |
|
| 42 | endif; |
|
| 43 | ||
| 44 | if ( ! function_exists( '_s_entry_footer' ) ) : |
|
| 45 | /** |
|