forked from mirror/_s
Fix translatability of comments title.
As per the guidelines in https://codex.wordpress.org/I18n_for_WordPress_Developers#Plurals This fixes an error notice which WPCS will start throwing once the - soon to be released - 0.10.0 version has become stable.
This commit is contained in:
parent
9700947f74
commit
8dbca77003
18
comments.php
18
comments.php
|
@ -27,11 +27,19 @@ if ( post_password_required() ) {
|
||||||
if ( have_comments() ) : ?>
|
if ( have_comments() ) : ?>
|
||||||
<h2 class="comments-title">
|
<h2 class="comments-title">
|
||||||
<?php
|
<?php
|
||||||
printf( // WPCS: XSS OK.
|
$comment_count = get_comments_number();
|
||||||
esc_html( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', '_s' ) ),
|
if ( 1 === $comment_count ) {
|
||||||
number_format_i18n( get_comments_number() ),
|
printf(
|
||||||
'<span>' . get_the_title() . '</span>'
|
esc_html_e( 'One thought on “%1$s”', '_s' ),
|
||||||
);
|
'<span>' . get_the_title() . '</span>'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
printf( // WPCS: XSS OK.
|
||||||
|
esc_html( _nx( '%1$s thought on “%2$s”', '%1$s thoughts on “%2$s”', $comment_count, 'comments title', '_s' ) ),
|
||||||
|
number_format_i18n( $comment_count ),
|
||||||
|
'<span>' . get_the_title() . '</span>'
|
||||||
|
);
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</h2><!-- .comments-title -->
|
</h2><!-- .comments-title -->
|
||||||
|
|
||||||
|
|
Reference in New Issue