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 Strip |
||||||||
12 | * @since 1.2.2 |
||||||||
13 | * @version 1.0 |
||||||||
14 | */ |
||||||||
15 | /* |
||||||||
16 | * If the current post is protected by a password and |
||||||||
17 | * the visitor has not yet entered the password we will |
||||||||
18 | * return early without loading the comments. |
||||||||
19 | */ |
||||||||
20 | if ( post_password_required() ) { |
||||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||||
21 | return; |
||||||||
22 | } |
||||||||
23 | ?> |
||||||||
24 | |||||||||
25 | <div id="comments" class="comments-area"> |
||||||||
26 | |||||||||
27 | <?php |
||||||||
28 | // You can start editing here -- including this comment! |
||||||||
29 | 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
![]() |
|||||||||
30 | <h2 class="comments-title"> |
||||||||
31 | <?php |
||||||||
32 | $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
![]() |
|||||||||
33 | if ( '1' === $comments_number ) { |
||||||||
34 | /* translators: %s: post title */ |
||||||||
35 | printf( esc_html_x( 'One Reply to “%s”', 'comments title', 'strip' ), get_the_title() ); |
||||||||
0 ignored issues
–
show
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
![]() 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
![]() |
|||||||||
36 | } else { |
||||||||
37 | printf( |
||||||||
38 | 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
![]() |
|||||||||
39 | /* translators: 1: number of comments, 2: post title */ |
||||||||
40 | _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
![]() |
|||||||||
41 | '%1$s Reply to “%2$s”', |
||||||||
42 | '%1$s Replies to “%2$s”', |
||||||||
43 | $comments_number, |
||||||||
44 | 'comments title', |
||||||||
45 | 'strip' |
||||||||
46 | ) |
||||||||
47 | ), |
||||||||
48 | esc_html( number_format_i18n( $comments_number ) ), |
||||||||
0 ignored issues
–
show
The function
esc_html 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
![]() 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
![]() |
|||||||||
49 | get_the_title() |
||||||||
50 | ); |
||||||||
51 | } |
||||||||
52 | ?> |
||||||||
53 | </h2> |
||||||||
54 | |||||||||
55 | <ol class="comment-list"> |
||||||||
56 | <?php |
||||||||
57 | 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
![]() |
|||||||||
58 | 'avatar_size' => 96, |
||||||||
59 | 'style' => 'ol', |
||||||||
60 | 'short_ping' => true, |
||||||||
61 | '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
![]() |
|||||||||
62 | ) ); |
||||||||
63 | ?> |
||||||||
64 | </ol> |
||||||||
65 | |||||||||
66 | <?php $comment_pagination = paginate_comments_links( |
||||||||
0 ignored issues
–
show
The function
paginate_comments_links 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
![]() |
|||||||||
67 | array( |
||||||||
68 | 'echo' => false, |
||||||||
69 | 'end_size' => 0, |
||||||||
70 | 'mid_size' => 0, |
||||||||
71 | 'next_text' => __( 'Newer Comments', 'Strip' ) . ' →', |
||||||||
72 | 'prev_text' => '← ' . __( 'Older Comments', 'Strip' ), |
||||||||
73 | ) |
||||||||
74 | ); |
||||||||
75 | if ( $comment_pagination ) { |
||||||||
76 | $pagination_classes = ''; |
||||||||
77 | // If we're only showing the "Next" link, add a class indicating so. |
||||||||
78 | if ( false === strpos( $comment_pagination, 'prev page-numbers' ) ) { |
||||||||
79 | $pagination_classes = ' only-next'; |
||||||||
80 | } |
||||||||
81 | ?> |
||||||||
82 | |||||||||
83 | <nav class="comments-pagination pagination<?php echo $pagination_classes; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>" aria-label="<?php esc_attr_e( 'Comments', 'Strip' ); ?>"> |
||||||||
0 ignored issues
–
show
The function
esc_attr_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
![]() |
|||||||||
84 | <?php echo wp_kses_post( $comment_pagination ); ?> |
||||||||
0 ignored issues
–
show
The function
wp_kses_post 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
![]() |
|||||||||
85 | </nav> |
||||||||
86 | |||||||||
87 | <?php |
||||||||
88 | } |
||||||||
89 | |||||||||
90 | endif; // Check for have_comments(). |
||||||||
91 | |||||||||
92 | // If comments are closed and there are comments, let's leave a little note, shall we? |
||||||||
93 | if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?> |
||||||||
0 ignored issues
–
show
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
![]() 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
![]() 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
![]() |
|||||||||
94 | |||||||||
95 | <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
![]() |
|||||||||
96 | <?php |
||||||||
97 | endif; |
||||||||
98 | |||||||||
99 | 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
![]() |
|||||||||
100 | ?> |
||||||||
101 | |||||||||
102 | </div><!-- #comments --> |
||||||||
103 |