Merge pull request #1226 from Ismail-elkorchi/_s_posted
Split _s_posted_on into two functions
This commit is contained in:
commit
388951f1ee
3 changed files with 20 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue