Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'Automattic/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
dsgreen committed Feb 15, 2018
2 parents 3678882 + 388951f commit 761e47d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
4 changes: 2 additions & 2 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
<h2 class="comments-title">
<?php
$comment_count = get_comments_number();
if ( 1 === $comment_count ) {
if ( '1' === $comment_count ) {
printf(
/* translators: 1: title. */
esc_html_e( 'One thought on &ldquo;%1$s&rdquo;', '_s' ),
esc_html__( 'One thought on &ldquo;%1$s&rdquo;', '_s' ),
'<span>' . get_the_title() . '</span>'
);
} else {
Expand Down
14 changes: 12 additions & 2 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>';
Expand All @@ -30,13 +30,23 @@ function _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;
Expand Down
5 changes: 4 additions & 1 deletion template-parts/content-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@

<?php if ( 'post' === get_post_type() ) : ?>
<div class="entry-meta">
<?php _s_posted_on(); ?>
<?php
_s_posted_on();
_s_posted_by();
?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
Expand Down
5 changes: 4 additions & 1 deletion template-parts/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@

if ( 'post' === get_post_type() ) : ?>
<div class="entry-meta">
<?php _s_posted_on(); ?>
<?php
_s_posted_on();
_s_posted_by();
?>
</div><!-- .entry-meta -->
<?php
endif; ?>
Expand Down

0 comments on commit 761e47d

Please sign in to comment.