run:R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
23.8 KB
2026-03-11 16:18:51
R W Run
7.8 KB
2026-03-11 16:18:52
R W Run
36.1 KB
2026-03-11 16:18:51
R W Run
11.9 KB
2026-03-11 16:18:52
R W Run
18.94 KB
2026-03-11 16:18:52
R W Run
7.35 KB
2026-03-11 16:18:52
R W Run
28.6 KB
2026-03-11 16:18:51
R W Run
316 By
2026-03-11 16:18:51
R W Run
12.9 KB
2026-03-11 16:18:51
R W Run
61.02 KB
2026-03-11 16:18:52
R W Run
15 KB
2026-03-11 16:18:51
R W Run
112.05 KB
2026-03-11 16:18:51
R W Run
12.47 KB
2026-03-11 16:18:51
R W Run
15.07 KB
2026-03-11 16:18:52
R W Run
9.84 KB
2026-03-11 16:18:52
R W Run
13.17 KB
2026-03-11 16:18:52
R W Run
33.83 KB
2026-03-11 16:18:51
R W Run
42.63 KB
2026-03-11 16:18:51
R W Run
55.71 KB
2026-03-11 16:18:52
R W Run
12.53 KB
2026-03-11 16:18:51
R W Run
2.55 KB
2026-03-11 16:18:52
R W Run
28.92 KB
2026-03-11 16:18:52
R W Run
539 By
2026-03-11 16:18:51
R W Run
367 By
2026-03-11 16:18:52
R W Run
42.65 KB
2026-03-11 16:18:51
R W Run
401 By
2026-03-11 16:18:51
R W Run
6.61 KB
2026-03-11 16:18:51
R W Run
664 By
2026-03-11 16:18:52
R W Run
20.63 KB
2026-03-11 16:18:51
R W Run
2.18 KB
2026-03-11 16:18:52
R W Run
453 By
2026-03-11 16:18:52
R W Run
457 By
2026-03-11 16:18:51
R W Run
36.83 KB
2026-03-11 16:18:52
R W Run
2.41 KB
2026-03-11 16:18:52
R W Run
8.28 KB
2026-03-11 16:18:51
R W Run
13.89 KB
2026-03-11 16:18:51
R W Run
11.76 KB
2026-03-11 16:18:51
R W Run
2.65 KB
2026-03-11 16:18:51
R W Run
7.43 KB
2026-03-11 16:18:51
R W Run
17.46 KB
2026-03-11 16:18:51
R W Run
5.14 KB
2026-03-11 16:18:52
R W Run
16.7 KB
2026-03-11 16:18:51
R W Run
8.28 KB
2026-03-11 16:18:52
R W Run
2.92 KB
2026-03-11 16:18:52
R W Run
1.32 KB
2026-03-11 16:18:51
R W Run
4.6 KB
2026-03-11 16:18:52
R W Run
11.62 KB
2026-03-11 16:18:52
R W Run
2.5 KB
2026-03-11 16:18:51
R W Run
1.97 KB
2026-03-11 16:18:51
R W Run
11.25 KB
2026-03-11 16:18:52
R W Run
5.32 KB
2026-03-11 16:18:51
R W Run
10.99 KB
2026-03-11 16:18:52
R W Run
68.32 KB
2026-03-11 16:18:51
R W Run
6.34 KB
2026-03-11 16:18:51
R W Run
5.49 KB
2026-03-11 16:18:51
R W Run
1.99 KB
2026-03-11 16:18:52
R W Run
7.02 KB
2026-03-11 16:18:51
R W Run
4.91 KB
2026-03-11 16:18:52
R W Run
16.86 KB
2026-03-11 16:18:51
R W Run
24.23 KB
2026-03-11 16:18:51
R W Run
3.97 KB
2026-03-11 16:18:51
R W Run
47.66 KB
2026-03-11 16:18:51
R W Run
9.22 KB
2026-03-11 16:18:51
R W Run
25.51 KB
2026-03-11 16:18:51
R W Run
198.38 KB
2026-03-11 16:18:52
R W Run
56.65 KB
2026-03-11 16:18:51
R W Run
10.46 KB
2026-03-11 16:18:51
R W Run
10.95 KB
2026-03-11 16:18:52
R W Run
29.26 KB
2026-03-11 16:18:51
R W Run
70.91 KB
2026-03-11 16:18:52
R W Run
35.3 KB
2026-03-11 16:18:52
R W Run
16.61 KB
2026-03-11 16:18:52
R W Run
2.57 KB
2026-03-11 16:18:52
R W Run
39.83 KB
2026-03-11 16:18:51
R W Run
70.64 KB
2026-03-11 16:18:51
R W Run
15.56 KB
2026-03-11 16:18:52
R W Run
7.33 KB
2026-03-11 16:18:52
R W Run
253 By
2026-03-11 16:18:51
R W Run
7.96 KB
2026-03-11 16:18:52
R W Run
3.23 KB
2026-03-11 16:18:52
R W Run
969 By
2026-03-11 16:18:52
R W Run
16.28 KB
2026-03-11 16:18:51
R W Run
7.22 KB
2026-03-11 16:18:51
R W Run
12.95 KB
2026-03-11 16:18:51
R W Run
6.53 KB
2026-03-11 16:18:51
R W Run
3.42 KB
2026-03-11 16:18:52
R W Run
5.84 KB
2026-03-11 16:18:51
R W Run
1.97 KB
2026-03-11 16:18:51
R W Run
4.3 KB
2026-03-11 16:18:52
R W Run
2.91 KB
2026-03-11 16:18:51
R W Run
16.46 KB
2026-03-11 16:18:52
R W Run
40.6 KB
2026-03-11 16:18:51
R W Run
20.22 KB
2026-03-11 16:18:51
R W Run
36.11 KB
2026-03-11 16:18:52
R W Run
17.01 KB
2026-03-11 16:18:51
R W Run
7.27 KB
2026-03-11 16:18:52
R W Run
6.62 KB
2026-03-11 16:18:52
R W Run
16.49 KB
2026-03-11 16:18:52
R W Run
1.79 KB
2026-03-11 16:18:52
R W Run
29.82 KB
2026-03-11 16:18:51
R W Run
6.67 KB
2026-03-11 16:18:52
R W Run
8.98 KB
2026-03-11 16:18:52
R W Run
19.42 KB
2026-03-11 16:18:51
R W Run
12.01 KB
2026-03-11 16:18:51
R W Run
17.11 KB
2026-03-11 16:18:51
R W Run
6.74 KB
2026-03-11 16:18:52
R W Run
30.93 KB
2026-03-11 16:18:51
R W Run
4.99 KB
2026-03-11 16:18:51
R W Run
4.25 KB
2026-03-11 16:18:51
R W Run
24.72 KB
2026-03-11 16:18:51
R W Run
29.96 KB
2026-03-11 16:18:52
R W Run
6.41 KB
2026-03-11 16:18:51
R W Run
160 KB
2026-03-11 16:18:51
R W Run
6.72 KB
2026-03-11 16:18:52
R W Run
10.92 KB
2026-03-11 16:18:51
R W Run
4.77 KB
2026-03-11 16:18:51
R W Run
3.38 KB
2026-03-11 16:18:51
R W Run
11.18 KB
2026-03-11 16:18:51
R W Run
62.19 KB
2026-03-11 16:18:51
R W Run
2.46 KB
2026-03-11 16:18:51
R W Run
9.17 KB
2026-03-11 16:18:51
R W Run
32.15 KB
2026-03-11 16:18:51
R W Run
34.05 KB
2026-03-11 16:18:52
R W Run
7.15 KB
2026-03-11 16:18:51
R W Run
3.47 KB
2026-03-11 16:18:52
R W Run
1.87 KB
2026-03-11 16:18:52
R W Run
30.91 KB
2026-03-11 16:18:51
R W Run
7.29 KB
2026-03-11 16:18:52
R W Run
7.35 KB
2026-03-11 16:18:51
R W Run
12.54 KB
2026-03-11 16:18:51
R W Run
19.12 KB
2026-03-11 16:18:51
R W Run
18.12 KB
2026-03-11 16:18:52
R W Run
39.99 KB
2026-03-11 16:18:52
R W Run
5.17 KB
2026-03-11 16:18:52
R W Run
979 By
2026-03-11 16:18:51
R W Run
18.44 KB
2026-03-11 16:18:52
R W Run
10.24 KB
2026-03-11 16:18:51
R W Run
1.77 KB
2026-03-11 16:18:52
R W Run
34.9 KB
2026-03-11 16:18:51
R W Run
7.19 KB
2026-03-11 16:18:52
R W Run
160.5 KB
2026-03-11 16:18:51
R W Run
64.27 KB
2026-03-11 16:18:51
R W Run
27.95 KB
2026-03-11 16:18:51
R W Run
4.69 KB
2026-03-11 16:18:51
R W Run
2.94 KB
2026-03-11 16:18:51
R W Run
43.13 KB
2026-03-11 16:18:52
R W Run
2.25 KB
2026-03-11 16:18:52
R W Run
22.5 KB
2026-03-11 16:18:51
R W Run
13.01 KB
2026-03-11 16:18:52
R W Run
3.27 KB
2026-03-11 16:18:51
R W Run
18 KB
2026-03-11 16:18:51
R W Run
210.4 KB
2026-03-11 16:18:52
R W Run
25.86 KB
2026-03-11 16:18:52
R W Run
115.85 KB
2026-03-11 16:18:51
R W Run
373 By
2026-03-11 16:18:52
R W Run
343 By
2026-03-11 16:18:52
R W Run
338 By
2026-03-11 16:18:51
R W Run
100.73 KB
2026-03-11 16:18:52
R W Run
130.93 KB
2026-03-11 16:18:51
R W Run
19.1 KB
2026-03-11 16:18:51
R W Run
17.41 KB
2026-03-11 16:18:52
R W Run
41.98 KB
2026-03-11 16:18:52
R W Run
400 By
2026-03-11 16:18:52
R W Run
11.1 KB
2026-03-11 16:18:52
R W Run
37.02 KB
2026-03-11 16:18:51
R W Run
2.24 KB
2026-03-11 16:18:51
R W Run
188.13 KB
2026-03-11 16:18:51
R W Run
338 By
2026-03-11 16:18:51
R W Run
38 KB
2026-03-11 16:18:51
R W Run
4.02 KB
2026-03-11 16:18:52
R W Run
5.38 KB
2026-03-11 16:18:51
R W Run
3.05 KB
2026-03-11 16:18:52
R W Run
2.61 KB
2026-03-11 16:18:51
R W Run
1.16 KB
2026-03-11 16:18:52
R W Run
4.04 KB
2026-03-11 16:18:51
R W Run
3.71 KB
2026-03-11 16:18:51
R W Run
24.6 KB
2026-03-11 16:18:51
R W Run
9.56 KB
2026-03-11 16:18:51
R W Run
346.43 KB
2026-03-11 16:18:52
R W Run
281.84 KB
2026-03-11 16:18:52
R W Run
14.95 KB
2026-03-11 16:18:51
R W Run
8.44 KB
2026-03-11 16:18:52
R W Run
168.95 KB
2026-03-11 16:18:52
R W Run
20.71 KB
2026-03-11 16:18:52
R W Run
25.27 KB
2026-03-11 16:18:51
R W Run
5.72 KB
2026-03-11 16:18:51
R W Run
4.63 KB
2026-03-11 16:18:52
R W Run
81.73 KB
2026-03-11 16:18:51
R W Run
67.18 KB
2026-03-11 16:18:51
R W Run
156.36 KB
2026-03-11 16:18:52
R W Run
55.19 KB
2026-03-11 16:18:51
R W Run
162 By
2026-03-11 16:18:51
R W Run
61.72 KB
2026-03-11 16:18:51
R W Run
216.06 KB
2026-03-11 16:18:52
R W Run
65.09 KB
2026-03-11 16:18:51
R W Run
25.24 KB
2026-03-11 16:18:52
R W Run
4.81 KB
2026-03-11 16:18:51
R W Run
6.48 KB
2026-03-11 16:18:52
R W Run
21.25 KB
2026-03-11 16:18:51
R W Run
2.79 KB
2026-03-11 16:18:52
R W Run
89.69 KB
2026-03-11 16:18:52
R W Run
19.42 KB
2026-03-11 16:18:52
R W Run
3.69 KB
2026-03-11 16:18:52
R W Run
4.11 KB
2026-03-11 16:18:51
R W Run
40.74 KB
2026-03-11 16:18:51
R W Run
25.38 KB
2026-03-11 16:18:51
R W Run
43.31 KB
2026-03-11 16:18:52
R W Run
102.57 KB
2026-03-11 16:18:52
R W Run
6.18 KB
2026-03-11 16:18:51
R W Run
124.47 KB
2026-03-11 16:18:52
R W Run
35.65 KB
2026-03-11 16:18:52
R W Run
6.94 KB
2026-03-11 16:18:52
R W Run
67.04 KB
2026-03-11 16:18:52
R W Run
10.62 KB
2026-03-11 16:18:51
R W Run
289.35 KB
2026-03-11 16:18:52
R W Run
36.23 KB
2026-03-11 16:18:51
R W Run
200 By
2026-03-11 16:18:52
R W Run
200 By
2026-03-11 16:18:52
R W Run
98.29 KB
2026-03-11 16:18:52
R W Run
30.02 KB
2026-03-11 16:18:52
R W Run
19.03 KB
2026-03-11 16:18:52
R W Run
5.06 KB
2026-03-11 16:18:52
R W Run
255 By
2026-03-11 16:18:51
R W Run
22.66 KB
2026-03-11 16:18:52
R W Run
154.63 KB
2026-03-11 16:18:51
R W Run
9.68 KB
2026-03-11 16:18:51
R W Run
258 By
2026-03-11 16:18:51
R W Run
23.49 KB
2026-03-11 16:18:51
R W Run
3.16 KB
2026-03-11 16:18:51
R W Run
8.4 KB
2026-03-11 16:18:52
R W Run
441 By
2026-03-11 16:18:51
R W Run
7.39 KB
2026-03-11 16:18:51
R W Run
173 KB
2026-03-11 16:18:52
R W Run
544 By
2026-03-11 16:18:52
R W Run
4.17 KB
2026-03-11 16:18:51
R W Run
35.97 KB
2026-03-11 16:18:52
R W Run
1.69 KB
2026-03-11 16:18:51
R W Run
2.84 KB
2026-03-11 16:18:52
R W Run
6.09 KB
2026-03-11 16:18:51
R W Run
8.71 KB
2026-03-11 16:18:51
R W Run
131.84 KB
2026-03-11 16:18:51
R W Run
37.45 KB
2026-03-11 16:18:51
R W Run
173.89 KB
2026-03-11 16:18:51
R W Run
7.09 KB
2026-03-11 16:18:51
R W Run
6.41 KB
2026-03-11 16:18:51
R W Run
1.08 KB
2026-03-11 16:18:51
R W Run
69.46 KB
2026-03-11 16:18:52
R W Run
445 By
2026-03-11 16:18:51
R W Run
799 By
2026-03-11 16:18:52
R W Run
error_log
📄class-walker-comment.php
1<?php
2/**
3 * Comment API: Walker_Comment class
4 *
5 * @package WordPress
6 * @subpackage Comments
7 * @since 4.4.0
8 */
9
10/**
11 * Core walker class used to create an HTML list of comments.
12 *
13 * @since 2.7.0
14 *
15 * @see Walker
16 */
17class Walker_Comment extends Walker {
18
19 /**
20 * What the class handles.
21 *
22 * @since 2.7.0
23 * @var string
24 *
25 * @see Walker::$tree_type
26 */
27 public $tree_type = 'comment';
28
29 /**
30 * Database fields to use.
31 *
32 * @since 2.7.0
33 * @var string[]
34 *
35 * @see Walker::$db_fields
36 * @todo Decouple this
37 */
38 public $db_fields = array(
39 'parent' => 'comment_parent',
40 'id' => 'comment_ID',
41 );
42
43 /**
44 * Starts the list before the elements are added.
45 *
46 * @since 2.7.0
47 *
48 * @see Walker::start_lvl()
49 * @global int $comment_depth
50 *
51 * @param string $output Used to append additional content (passed by reference).
52 * @param int $depth Optional. Depth of the current comment. Default 0.
53 * @param array $args Optional. Uses 'style' argument for type of HTML list. Default empty array.
54 */
55 public function start_lvl( &$output, $depth = 0, $args = array() ) {
56 $GLOBALS['comment_depth'] = $depth + 1;
57
58 switch ( $args['style'] ) {
59 case 'div':
60 break;
61 case 'ol':
62 $output .= '<ol class="children">' . "\n";
63 break;
64 case 'ul':
65 default:
66 $output .= '<ul class="children">' . "\n";
67 break;
68 }
69 }
70
71 /**
72 * Ends the list of items after the elements are added.
73 *
74 * @since 2.7.0
75 *
76 * @see Walker::end_lvl()
77 * @global int $comment_depth
78 *
79 * @param string $output Used to append additional content (passed by reference).
80 * @param int $depth Optional. Depth of the current comment. Default 0.
81 * @param array $args Optional. Will only append content if style argument value is 'ol' or 'ul'.
82 * Default empty array.
83 */
84 public function end_lvl( &$output, $depth = 0, $args = array() ) {
85 $GLOBALS['comment_depth'] = $depth + 1;
86
87 switch ( $args['style'] ) {
88 case 'div':
89 break;
90 case 'ol':
91 $output .= "</ol><!-- .children -->\n";
92 break;
93 case 'ul':
94 default:
95 $output .= "</ul><!-- .children -->\n";
96 break;
97 }
98 }
99
100 /**
101 * Traverses elements to create list from elements.
102 *
103 * This function is designed to enhance Walker::display_element() to
104 * display children of higher nesting levels than selected inline on
105 * the highest depth level displayed. This prevents them being orphaned
106 * at the end of the comment list.
107 *
108 * Example: max_depth = 2, with 5 levels of nested content.
109 * 1
110 * 1.1
111 * 1.1.1
112 * 1.1.1.1
113 * 1.1.1.1.1
114 * 1.1.2
115 * 1.1.2.1
116 * 2
117 * 2.2
118 *
119 * @since 2.7.0
120 *
121 * @see Walker::display_element()
122 * @see wp_list_comments()
123 *
124 * @param WP_Comment $element Comment data object.
125 * @param array $children_elements List of elements to continue traversing. Passed by reference.
126 * @param int $max_depth Max depth to traverse.
127 * @param int $depth Depth of the current element.
128 * @param array $args An array of arguments.
129 * @param string $output Used to append additional content. Passed by reference.
130 */
131 public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
132 if ( ! $element ) {
133 return;
134 }
135
136 $id_field = $this->db_fields['id'];
137 $id = $element->$id_field;
138
139 parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
140
141 /*
142 * If at the max depth, and the current element still has children, loop over those
143 * and display them at this level. This is to prevent them being orphaned to the end
144 * of the list.
145 */
146 if ( $max_depth <= $depth + 1 && isset( $children_elements[ $id ] ) ) {
147 foreach ( $children_elements[ $id ] as $child ) {
148 $this->display_element( $child, $children_elements, $max_depth, $depth, $args, $output );
149 }
150
151 unset( $children_elements[ $id ] );
152 }
153 }
154
155 /**
156 * Starts the element output.
157 *
158 * @since 2.7.0
159 * @since 5.9.0 Renamed `$comment` to `$data_object` and `$id` to `$current_object_id`
160 * to match parent class for PHP 8 named parameter support.
161 *
162 * @see Walker::start_el()
163 * @see wp_list_comments()
164 * @global int $comment_depth
165 * @global WP_Comment $comment Global comment object.
166 *
167 * @param string $output Used to append additional content. Passed by reference.
168 * @param WP_Comment $data_object Comment data object.
169 * @param int $depth Optional. Depth of the current comment in reference to parents. Default 0.
170 * @param array $args Optional. An array of arguments. Default empty array.
171 * @param int $current_object_id Optional. ID of the current comment. Default 0.
172 */
173 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) {
174 // Restores the more descriptive, specific name for use within this method.
175 $comment = $data_object;
176
177 ++$depth;
178 $GLOBALS['comment_depth'] = $depth;
179 $GLOBALS['comment'] = $comment;
180
181 if ( ! empty( $args['callback'] ) ) {
182 ob_start();
183 call_user_func( $args['callback'], $comment, $args, $depth );
184 $output .= ob_get_clean();
185 return;
186 }
187
188 if ( 'comment' === $comment->comment_type ) {
189 add_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40, 2 );
190 }
191
192 if ( ( 'pingback' === $comment->comment_type || 'trackback' === $comment->comment_type ) && $args['short_ping'] ) {
193 ob_start();
194 $this->ping( $comment, $depth, $args );
195 $output .= ob_get_clean();
196 } elseif ( 'html5' === $args['format'] ) {
197 ob_start();
198 $this->html5_comment( $comment, $depth, $args );
199 $output .= ob_get_clean();
200 } else {
201 ob_start();
202 $this->comment( $comment, $depth, $args );
203 $output .= ob_get_clean();
204 }
205
206 if ( 'comment' === $comment->comment_type ) {
207 remove_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40 );
208 }
209 }
210
211 /**
212 * Ends the element output, if needed.
213 *
214 * @since 2.7.0
215 * @since 5.9.0 Renamed `$comment` to `$data_object` to match parent class for PHP 8 named parameter support.
216 *
217 * @see Walker::end_el()
218 * @see wp_list_comments()
219 *
220 * @param string $output Used to append additional content. Passed by reference.
221 * @param WP_Comment $data_object Comment data object.
222 * @param int $depth Optional. Depth of the current comment. Default 0.
223 * @param array $args Optional. An array of arguments. Default empty array.
224 */
225 public function end_el( &$output, $data_object, $depth = 0, $args = array() ) {
226 if ( ! empty( $args['end-callback'] ) ) {
227 ob_start();
228 call_user_func(
229 $args['end-callback'],
230 $data_object, // The current comment object.
231 $args,
232 $depth
233 );
234 $output .= ob_get_clean();
235 return;
236 }
237 if ( 'div' === $args['style'] ) {
238 $output .= "</div><!-- #comment-## -->\n";
239 } else {
240 $output .= "</li><!-- #comment-## -->\n";
241 }
242 }
243
244 /**
245 * Outputs a pingback comment.
246 *
247 * @since 3.6.0
248 *
249 * @see wp_list_comments()
250 *
251 * @param WP_Comment $comment The comment object.
252 * @param int $depth Depth of the current comment.
253 * @param array $args An array of arguments.
254 */
255 protected function ping( $comment, $depth, $args ) {
256 $tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
257 ?>
258 <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( '', $comment ); ?>>
259 <div class="comment-body">
260 <?php _e( 'Pingback:' ); ?> <?php comment_author_link( $comment ); ?> <?php edit_comment_link( __( 'Edit' ), '<span class="edit-link">', '</span>' ); ?>
261 </div>
262 <?php
263 }
264
265 /**
266 * Filters the comment text.
267 *
268 * Removes links from the pending comment's text if the commenter did not consent
269 * to the comment cookies.
270 *
271 * @since 5.4.2
272 *
273 * @param string $comment_text Text of the current comment.
274 * @param WP_Comment|null $comment The comment object. Null if not found.
275 * @return string Filtered text of the current comment.
276 */
277 public function filter_comment_text( $comment_text, $comment ) {
278 $commenter = wp_get_current_commenter();
279 $show_pending_links = ! empty( $commenter['comment_author'] );
280
281 if ( $comment && '0' === $comment->comment_approved && ! $show_pending_links ) {
282 $comment_text = wp_kses( $comment_text, array() );
283 }
284
285 return $comment_text;
286 }
287
288 /**
289 * Outputs a single comment.
290 *
291 * @since 3.6.0
292 *
293 * @see wp_list_comments()
294 *
295 * @param WP_Comment $comment Comment to display.
296 * @param int $depth Depth of the current comment.
297 * @param array $args An array of arguments.
298 */
299 protected function comment( $comment, $depth, $args ) {
300 if ( 'div' === $args['style'] ) {
301 $tag = 'div';
302 $add_below = 'comment';
303 } else {
304 $tag = 'li';
305 $add_below = 'div-comment';
306 }
307
308 $commenter = wp_get_current_commenter();
309 $show_pending_links = isset( $commenter['comment_author'] ) && $commenter['comment_author'];
310
311 if ( $commenter['comment_author_email'] ) {
312 $moderation_note = __( 'Your comment is awaiting moderation.' );
313 } else {
314 $moderation_note = __( 'Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.' );
315 }
316 ?>
317 <<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?> id="comment-<?php comment_ID(); ?>">
318 <?php if ( 'div' !== $args['style'] ) : ?>
319 <div id="div-comment-<?php comment_ID(); ?>" class="comment-body">
320 <?php endif; ?>
321 <div class="comment-author vcard">
322 <?php
323 if ( 0 !== $args['avatar_size'] ) {
324 echo get_avatar( $comment, $args['avatar_size'] );
325 }
326 ?>
327 <?php
328 $comment_author = get_comment_author_link( $comment );
329
330 if ( '0' === $comment->comment_approved && ! $show_pending_links ) {
331 $comment_author = get_comment_author( $comment );
332 }
333
334 printf(
335 /* translators: %s: Comment author link. */
336 __( '%s <span class="says">says:</span>' ),
337 sprintf( '<cite class="fn">%s</cite>', $comment_author )
338 );
339 ?>
340 </div>
341 <?php if ( '0' === $comment->comment_approved ) : ?>
342 <em class="comment-awaiting-moderation"><?php echo $moderation_note; ?></em>
343 <br />
344 <?php endif; ?>
345
346 <div class="comment-meta commentmetadata">
347 <?php
348 printf(
349 '<a href="%s">%s</a>',
350 esc_url( get_comment_link( $comment, $args ) ),
351 sprintf(
352 /* translators: 1: Comment date, 2: Comment time. */
353 __( '%1$s at %2$s' ),
354 get_comment_date( '', $comment ),
355 get_comment_time()
356 )
357 );
358
359 edit_comment_link( __( '(Edit)' ), ' &nbsp;&nbsp;', '' );
360 ?>
361 </div>
362
363 <?php
364 comment_text(
365 $comment,
366 array_merge(
367 $args,
368 array(
369 'add_below' => $add_below,
370 'depth' => $depth,
371 'max_depth' => $args['max_depth'],
372 )
373 )
374 );
375 ?>
376
377 <?php
378 comment_reply_link(
379 array_merge(
380 $args,
381 array(
382 'add_below' => $add_below,
383 'depth' => $depth,
384 'max_depth' => $args['max_depth'],
385 'before' => '<div class="reply">',
386 'after' => '</div>',
387 )
388 )
389 );
390 ?>
391
392 <?php if ( 'div' !== $args['style'] ) : ?>
393 </div>
394 <?php endif; ?>
395 <?php
396 }
397
398 /**
399 * Outputs a comment in the HTML5 format.
400 *
401 * @since 3.6.0
402 *
403 * @see wp_list_comments()
404 *
405 * @param WP_Comment $comment Comment to display.
406 * @param int $depth Depth of the current comment.
407 * @param array $args An array of arguments.
408 */
409 protected function html5_comment( $comment, $depth, $args ) {
410 $tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
411
412 $commenter = wp_get_current_commenter();
413 $show_pending_links = ! empty( $commenter['comment_author'] );
414
415 if ( $commenter['comment_author_email'] ) {
416 $moderation_note = __( 'Your comment is awaiting moderation.' );
417 } else {
418 $moderation_note = __( 'Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.' );
419 }
420 ?>
421 <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>
422 <article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
423 <footer class="comment-meta">
424 <div class="comment-author vcard">
425 <?php
426 if ( 0 !== $args['avatar_size'] ) {
427 echo get_avatar( $comment, $args['avatar_size'] );
428 }
429 ?>
430 <?php
431 $comment_author = get_comment_author_link( $comment );
432
433 if ( '0' === $comment->comment_approved && ! $show_pending_links ) {
434 $comment_author = get_comment_author( $comment );
435 }
436
437 printf(
438 /* translators: %s: Comment author link. */
439 __( '%s <span class="says">says:</span>' ),
440 sprintf( '<b class="fn">%s</b>', $comment_author )
441 );
442 ?>
443 </div><!-- .comment-author -->
444
445 <div class="comment-metadata">
446 <?php
447 printf(
448 '<a href="%s"><time datetime="%s">%s</time></a>',
449 esc_url( get_comment_link( $comment, $args ) ),
450 get_comment_time( 'c' ),
451 sprintf(
452 /* translators: 1: Comment date, 2: Comment time. */
453 __( '%1$s at %2$s' ),
454 get_comment_date( '', $comment ),
455 get_comment_time()
456 )
457 );
458
459 edit_comment_link( __( 'Edit' ), ' <span class="edit-link">', '</span>' );
460 ?>
461 </div><!-- .comment-metadata -->
462
463 <?php if ( '0' === $comment->comment_approved ) : ?>
464 <em class="comment-awaiting-moderation"><?php echo $moderation_note; ?></em>
465 <?php endif; ?>
466 </footer><!-- .comment-meta -->
467
468 <div class="comment-content">
469 <?php comment_text(); ?>
470 </div><!-- .comment-content -->
471
472 <?php
473 if ( '1' === $comment->comment_approved || $show_pending_links ) {
474 comment_reply_link(
475 array_merge(
476 $args,
477 array(
478 'add_below' => 'div-comment',
479 'depth' => $depth,
480 'max_depth' => $args['max_depth'],
481 'before' => '<div class="reply">',
482 'after' => '</div>',
483 )
484 )
485 );
486 }
487 ?>
488 </article><!-- .comment-body -->
489 <?php
490 }
491}
492