CS: prefix all variables

While template files are intended to be included from within a function, this doesn't guarantee they always will be.

Therefore all variables declared within template files also need to be prefixed with a theme specific prefix.

As these are "local" variables, renaming them does not constitute a BC-break.
This commit is contained in:
jrfnl 2018-02-27 11:35:30 +01:00
parent ec877e48c3
commit 98e3e75109
3 changed files with 9 additions and 9 deletions

View file

@ -28,8 +28,8 @@ if ( post_password_required() ) {
?>
<h2 class="comments-title">
<?php
$comment_count = get_comments_number();
if ( '1' === $comment_count ) {
$_s_comment_count = get_comments_number();
if ( '1' === $_s_comment_count ) {
printf(
/* translators: 1: title. */
esc_html__( 'One thought on &ldquo;%1$s&rdquo;', '_s' ),
@ -38,8 +38,8 @@ if ( post_password_required() ) {
} else {
printf( // WPCS: XSS OK.
/* translators: 1: comment count number, 2: title. */
esc_html( _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $comment_count, 'comments title', '_s' ) ),
number_format_i18n( $comment_count ),
esc_html( _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $_s_comment_count, 'comments title', '_s' ) ),
number_format_i18n( $_s_comment_count ),
'<span>' . get_the_title() . '</span>'
);
}