|
|
|
@ -7,11 +7,12 @@
|
|
|
|
|
* @package _s
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if ( ! function_exists( '_s_posted_on' ) ) :
|
|
|
|
|
if ( ! function_exists( '_s_posted_on_by' ) ) :
|
|
|
|
|
/**
|
|
|
|
|
* Prints HTML with meta information for the current post-date/time.
|
|
|
|
|
* Prints HTML with meta information for the current post-date/time and current author.
|
|
|
|
|
*/
|
|
|
|
|
function _s_posted_on() {
|
|
|
|
|
function _s_posted_on_by() {
|
|
|
|
|
|
|
|
|
|
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
|
|
|
|
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
|
|
|
|
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
|
|
|
@ -24,30 +25,12 @@ if ( ! function_exists( '_s_posted_on' ) ) :
|
|
|
|
|
esc_html( get_the_modified_date() )
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$posted_on = sprintf(
|
|
|
|
|
/* translators: %s: post date. */
|
|
|
|
|
esc_html_x( 'Posted on %s', 'post date', '_s' ),
|
|
|
|
|
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
echo '<span class="posted-on">' . $posted_on . '</span>'; // WPCS: XSS OK.
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
endif;
|
|
|
|
|
|
|
|
|
|
if ( ! function_exists( '_s_posted_by' ) ) :
|
|
|
|
|
/**
|
|
|
|
|
* Prints HTML with meta information for the current author.
|
|
|
|
|
*/
|
|
|
|
|
function _s_posted_by() {
|
|
|
|
|
$byline = sprintf(
|
|
|
|
|
/* translators: %s: post author. */
|
|
|
|
|
esc_html_x( 'by %s', 'post author', '_s' ),
|
|
|
|
|
printf(
|
|
|
|
|
/* translators: %1$s: post date, %2$s: post author . */
|
|
|
|
|
__( '<span class="posted-on">Posted on %1$s</span> <span class="byline">by %2$s</span>', '_s' ),
|
|
|
|
|
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>', // WPCS: XSS OK.
|
|
|
|
|
'<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>'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
echo '<span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
endif;
|
|
|
|
|
|
|
|
|
|