Merge pull request #1226 from Ismail-elkorchi/_s_posted

Split _s_posted_on into two functions
This commit is contained in:
Laurel 2018-01-26 09:50:01 -08:00 committed by GitHub
commit 388951f1ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 4 deletions

View file

@ -9,7 +9,7 @@
if ( ! function_exists( '_s_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
* Prints HTML with meta information for the current post-date/time.
*/
function _s_posted_on() {
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
@ -30,13 +30,23 @@ if ( ! function_exists( '_s_posted_on' ) ) :
'<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' ),
'<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="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.
echo '<span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.
}
endif;