Passed
Push — master ( 1b85a4...393c08 )
by SILENT
01:25
created

comments.php (17 issues)

1
<?php
2
/**
3
 * The template for displaying comments
4
 *
5
 * This is the template that displays the area of the page that contains both the current comments
6
 * and the comment form.
7
 *
8
 * @link https://codex.wordpress.org/Template_Hierarchy
9
 *
10
 * @package WordPress
11
 * @subpackage Twenty_Seventeen
12
 * @since 1.0
13
 * @version 1.0
14
 */
15
16
/*
17
 * If the current post is protected by a password and
18
 * the visitor has not yet entered the password we will
19
 * return early without loading the comments.
20
 */
21
if ( post_password_required() ) {
0 ignored issues
show
The function post_password_required was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
if ( /** @scrutinizer ignore-call */ post_password_required() ) {
Loading history...
22
	return;
23
}
24
?>
25
26
<div id="comments" class="comments-area">
27
28
	<?php
29
	// You can start editing here -- including this comment!
30
	if ( have_comments() ) : ?>
0 ignored issues
show
The function have_comments was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
	if ( /** @scrutinizer ignore-call */ have_comments() ) : ?>
Loading history...
31
		<h2 class="comments-title">
32
			<?php
33
				$comments_number = get_comments_number();
0 ignored issues
show
The function get_comments_number was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
				$comments_number = /** @scrutinizer ignore-call */ get_comments_number();
Loading history...
34
			if ( '1' === $comments_number ) {
35
				/* translators: %s: post title */
36
				printf( esc_html_x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'strip' ), get_the_title() );
0 ignored issues
show
The function get_the_title was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
				printf( esc_html_x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'strip' ), /** @scrutinizer ignore-call */ get_the_title() );
Loading history...
The function esc_html_x was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
				printf( /** @scrutinizer ignore-call */ esc_html_x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'strip' ), get_the_title() );
Loading history...
37
			} else {
38
				printf(
39
					esc_attr(
0 ignored issues
show
The function esc_attr was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

39
					/** @scrutinizer ignore-call */ 
40
     esc_attr(
Loading history...
40
						/* translators: 1: number of comments, 2: post title */
41
						_nx(
0 ignored issues
show
The function _nx was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

41
						/** @scrutinizer ignore-call */ 
42
      _nx(
Loading history...
42
							'%1$s Reply to &ldquo;%2$s&rdquo;',
43
							'%1$s Replies to &ldquo;%2$s&rdquo;',
44
							$comments_number,
45
							'comments title',
46
							'strip'
47
						)
48
					),
49
					number_format_i18n( $comments_number ),
0 ignored issues
show
The function number_format_i18n was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

49
					/** @scrutinizer ignore-call */ 
50
     number_format_i18n( $comments_number ),
Loading history...
50
					get_the_title()
51
				);
52
			}
53
			?>
54
		</h2>
55
56
		<ol class="comment-list">
57
			<?php
58
				wp_list_comments( array(
0 ignored issues
show
The function wp_list_comments was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

58
				/** @scrutinizer ignore-call */ 
59
    wp_list_comments( array(
Loading history...
59
					'avatar_size' => 96,
60
					'style'       => 'ol',
61
					'short_ping'  => true,
62
					'reply_text'  => __( 'Reply', 'strip' ),
0 ignored issues
show
The function __ was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

62
					'reply_text'  => /** @scrutinizer ignore-call */ __( 'Reply', 'strip' ),
Loading history...
63
				) );
64
			?>
65
		</ol>
66
67
		<?php the_comments_pagination( array(
0 ignored issues
show
The function the_comments_pagination was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

67
		<?php /** @scrutinizer ignore-call */ the_comments_pagination( array(
Loading history...
68
			'prev_text' => '<span class="screen-reader-text">' . __( 'Previous', 'strip' ) . '</span>',
69
			'next_text' => '<span class="screen-reader-text">' . __( 'Next', 'strip' ) . '</span>',
0 ignored issues
show
Expected a sanitizing function (see Codex for 'Data Validation'), but instead saw '__'
Loading history...
70
		) );
71
72
	endif; // Check for have_comments().
73
74
	// If comments are closed and there are comments, let's leave a little note, shall we?
75
	if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
0 ignored issues
show
The function get_post_type was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

75
	if ( ! comments_open() && get_comments_number() && post_type_supports( /** @scrutinizer ignore-call */ get_post_type(), 'comments' ) ) : ?>
Loading history...
The function post_type_supports was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

75
	if ( ! comments_open() && get_comments_number() && /** @scrutinizer ignore-call */ post_type_supports( get_post_type(), 'comments' ) ) : ?>
Loading history...
The function comments_open was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

75
	if ( ! /** @scrutinizer ignore-call */ comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
Loading history...
76
77
		<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'strip' ); ?></p>
0 ignored issues
show
The function esc_html_e was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

77
		<p class="no-comments"><?php /** @scrutinizer ignore-call */ esc_html_e( 'Comments are closed.', 'strip' ); ?></p>
Loading history...
78
	<?php
79
	endif;
80
81
	comment_form();
0 ignored issues
show
The function comment_form was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

81
	/** @scrutinizer ignore-call */ 
82
 comment_form();
Loading history...
82
	?>
83
84
</div><!-- #comments -->
85