-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcomments.php
183 lines (136 loc) · 4.73 KB
/
comments.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?php
if ( post_password_required() ) {
?>
<p class="nocomments">
<?php esc_html_e( 'This post is password protected. Enter the password to view comments.', 'comicpress' ); ?>
</p>
<?php
return;
}
if ( ! comments_open() && ! get_comments_number() ) {
return;
}
?>
<div id="comment-wrapper">
<?php
if ( comments_open() ) {
?>
<div class="commentsrsslink">
<?php
post_comments_feed_link( __( 'Comments RSS', 'comicpress' ) );
?>
</div>
<h4 id="comments">
<?php
comments_number( __( 'Discussion ¬', 'comicpress' ), __( 'Discussion ¬', 'comicpress' ), __( 'Discussion (%) ¬', 'comicpress' ) );
?>
</h4>
<?php
}
if ( isset( $comments_by_type['pings'] ) && ( ! isset( $wp_query->query_vars['cpage'] ) || ( (int) $wp_query->query_vars['cpage'] < 2 ) ) && ( count( $comments_by_type['pings'] ) > 0 ) ) {
?>
<div id="pingtrackback-wrap">
<ol class="commentlist">
<li>
<ul>
<?php
$comment_args = array(
'type' => 'pings',
'avatar_size' => 32,
'callback' => 'comicpress_comments_callback',
'end-callback' => 'comicpress_comments_end_callback',
);
wp_list_comments( $comment_args );
?>
</ul>
</li>
</ol>
</div>
<?php
}
if ( ! empty( $comments_by_type['comment'] ) ) {
?>
<ol class="commentlist">
<?php
$comment_args = array(
'type' => 'comment',
'reply_text' => __( 'Reply ¬', 'comicpress' ),
'callback' => 'comicpress_comments_callback',
'end-callback' => 'comicpress_comments_end_callback',
'avatar_size' => 64,
);
wp_list_comments( $comment_args );
?>
</ol>
<?php
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) {
if ( comicpress_themeinfo( 'enable_numbered_pagination' ) ) {
$pagelinks = paginate_comments_links( array( 'echo' => 0 ) );
if ( ! empty( $pagelinks ) ) {
$pagelinks = str_replace( '<a', '<li><a', $pagelinks );
$pagelinks = str_replace( '</a>', '</a></li>', $pagelinks );
$pagelinks = str_replace( '<span', '<li', $pagelinks );
$pagelinks = str_replace( '</span>', '</li>', $pagelinks );
?>
<div id="wp-paginav">
<div id="paginav">
<?phP
echo '<ul><li class="paginav-extend">' . esc_html__( 'Comment Pages', 'comicpress' ) . '</li>' . $pagelinks . '</ul>';
?>
</div>
<div class="clear"></div>
</div>
<?php
}
?>
<?php
} else {
?>
<div class="commentnav">
<div class="commentnav-right">
<?php
next_comments_link( __( 'Next Comments ↑', 'comicpress' ) );
?>
</div>
<div class="commentnav-left">
<?php
previous_comments_link( __( '↓ Previous Comments', 'comicpress' ) );
?>
</div>
<div class="clear"></div>
</div>
<?php
}
}
}
if ( comments_open() ) {
?>
<div class="comment-wrapper-respond">
<?php
$fields = array(
'author' => '<p class="comment-form-author">' . '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" />' . ' <label for="author"><small>' . __( '*NAME', 'comicpress' ) . '</small></label></p>',
'email' => '<p class="comment-form-email">' . '<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" /> <label for="email">' . __( '*EMAIL', 'comicpress' ) . '<small> — <a href="https://gravatar.com" target="_blank" rel="noopener noreferrer">' . __( 'Get a Gravatar', 'comicpress' ) . '</a></small></label></p>',
'url' => '<p class="comment-form-url">' . '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /> <label for="url">' . __( 'Website URL', 'comicpress' ) . '</label></p>',
);
$args = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" class="comment-textarea"></textarea></p>',
'comment_notes_after' => comicpress_themeinfo( 'disable_comment_note' ) ? '' : '<p class="comment-note"><strong><small>' . __( 'NOTE — You can use these HTML tags and attributes:', 'comicpress' ) . '</small></strong><br /><small><code>' . allowed_tags() . '</code></small></p>',
'title_reply' => __( 'Comment ¬', 'comicpress' ),
'title_reply_to' => __( 'Reply to %s ¬', 'comicpress' ),
'cancel_reply_link' => __( 'Cancel reply', 'comicpress' ),
'label_submit' => __( 'Post Comment', 'comicpress' ),
);
comment_form( $args );
?>
</div>
<?php
} elseif ( ! comments_open() && ( get_comments_number() > 0 ) ) {
?>
<p class="closed-comments">
<?php esc_html_e( 'Comments are closed.', 'comicpress' ); ?>
</p>
<?php
}
?>
</div>