185 array( |
214 array( |
186 'id' => 'moderating-comments', |
215 'id' => 'moderating-comments', |
187 'title' => __( 'Moderating Comments' ), |
216 'title' => __( 'Moderating Comments' ), |
188 'content' => |
217 'content' => |
189 '<p>' . __( 'A red bar on the left means the comment is waiting for you to moderate it.' ) . '</p>' . |
218 '<p>' . __( 'A red bar on the left means the comment is waiting for you to moderate it.' ) . '</p>' . |
190 '<p>' . __( 'In the <strong>Author</strong> column, in addition to the author’s name, email address, and blog URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' . |
219 '<p>' . __( 'In the <strong>Author</strong> column, in addition to the author’s name, email address, and site URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' . |
191 '<p>' . __( 'In the <strong>Comment</strong> column, hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' . |
220 '<p>' . __( 'In the <strong>Comment</strong> column, hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' . |
192 '<p>' . __( 'In the <strong>In response to</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If there are pending comments, a red notification circle with the number of pending comments is displayed. Clicking the notification circle will filter the comments screen to show only pending comments on that post.' ) . '</p>' . |
221 '<p>' . __( 'In the <strong>In response to</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If there are pending comments, a red notification circle with the number of pending comments is displayed. Clicking the notification circle will filter the comments screen to show only pending comments on that post.' ) . '</p>' . |
193 '<p>' . __( 'In the <strong>Submitted on</strong> column, the date and time the comment was left on your site appears. Clicking on the date/time link will take you to that comment on your live site.' ) . '</p>' . |
222 '<p>' . __( 'In the <strong>Submitted on</strong> column, the date and time the comment was left on your site appears. Clicking on the date/time link will take you to that comment on your live site.' ) . '</p>' . |
194 '<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>', |
223 '<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>', |
195 ) |
224 ) |
196 ); |
225 ); |
197 |
226 |
198 get_current_screen()->set_help_sidebar( |
227 get_current_screen()->set_help_sidebar( |
199 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
228 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
200 '<p>' . __( '<a href="https://wordpress.org/support/article/comments-screen/">Documentation on Comments</a>' ) . '</p>' . |
229 '<p>' . __( '<a href="https://wordpress.org/documentation/article/comments-screen/">Documentation on Comments</a>' ) . '</p>' . |
201 '<p>' . __( '<a href="https://wordpress.org/support/article/comment-spam/">Documentation on Comment Spam</a>' ) . '</p>' . |
230 '<p>' . __( '<a href="https://wordpress.org/documentation/article/understand-comment-spam/">Documentation on Comment Spam</a>' ) . '</p>' . |
202 '<p>' . __( '<a href="https://wordpress.org/support/article/keyboard-shortcuts/">Documentation on Keyboard Shortcuts</a>' ) . '</p>' . |
231 '<p>' . __( '<a href="https://wordpress.org/documentation/article/keyboard-shortcuts-classic-editor/#keyboard-shortcuts-for-comments">Documentation on Keyboard Shortcuts</a>' ) . '</p>' . |
203 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
232 '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' |
204 ); |
233 ); |
205 |
234 |
206 get_current_screen()->set_screen_reader_content( |
235 get_current_screen()->set_screen_reader_content( |
207 array( |
236 array( |
208 'heading_views' => __( 'Filter comments list' ), |
237 'heading_views' => __( 'Filter comments list' ), |
270 case 2: |
299 case 2: |
271 $error_msg = __( 'Sorry, you are not allowed to edit comments on this post.' ); |
300 $error_msg = __( 'Sorry, you are not allowed to edit comments on this post.' ); |
272 break; |
301 break; |
273 } |
302 } |
274 if ( $error_msg ) { |
303 if ( $error_msg ) { |
275 echo '<div id="moderated" class="error"><p>' . $error_msg . '</p></div>'; |
304 wp_admin_notice( |
276 } |
305 $error_msg, |
277 } |
306 array( |
278 |
307 'id' => 'moderated', |
279 if ( isset( $_REQUEST['approved'] ) || isset( $_REQUEST['deleted'] ) || isset( $_REQUEST['trashed'] ) || isset( $_REQUEST['untrashed'] ) || isset( $_REQUEST['spammed'] ) || isset( $_REQUEST['unspammed'] ) || isset( $_REQUEST['same'] ) ) { |
308 'additional_classes' => array( 'error' ), |
|
309 ) |
|
310 ); |
|
311 } |
|
312 } |
|
313 |
|
314 if ( isset( $_REQUEST['approved'] ) |
|
315 || isset( $_REQUEST['deleted'] ) |
|
316 || isset( $_REQUEST['trashed'] ) |
|
317 || isset( $_REQUEST['untrashed'] ) |
|
318 || isset( $_REQUEST['spammed'] ) |
|
319 || isset( $_REQUEST['unspammed'] ) |
|
320 || isset( $_REQUEST['same'] ) |
|
321 ) { |
280 $approved = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0; |
322 $approved = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0; |
281 $deleted = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0; |
323 $deleted = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0; |
282 $trashed = isset( $_REQUEST['trashed'] ) ? (int) $_REQUEST['trashed'] : 0; |
324 $trashed = isset( $_REQUEST['trashed'] ) ? (int) $_REQUEST['trashed'] : 0; |
283 $untrashed = isset( $_REQUEST['untrashed'] ) ? (int) $_REQUEST['untrashed'] : 0; |
325 $untrashed = isset( $_REQUEST['untrashed'] ) ? (int) $_REQUEST['untrashed'] : 0; |
284 $spammed = isset( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0; |
326 $spammed = isset( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0; |
285 $unspammed = isset( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0; |
327 $unspammed = isset( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0; |
286 $same = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['same'] : 0; |
328 $same = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['same'] : 0; |
287 |
329 |
288 if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) { |
330 if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) { |
289 if ( $approved > 0 ) { |
331 if ( $approved > 0 ) { |
290 /* translators: %s: Number of comments. */ |
332 $messages[] = sprintf( |
291 $messages[] = sprintf( _n( '%s comment approved.', '%s comments approved.', $approved ), $approved ); |
333 /* translators: %s: Number of comments. */ |
|
334 _n( '%s comment approved.', '%s comments approved.', $approved ), |
|
335 $approved |
|
336 ); |
292 } |
337 } |
293 |
338 |
294 if ( $spammed > 0 ) { |
339 if ( $spammed > 0 ) { |
295 $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0; |
340 $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0; |
296 /* translators: %s: Number of comments. */ |
341 |
297 $messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", 'bulk-comments' ) ) . '">' . __( 'Undo' ) . '</a><br />'; |
342 $messages[] = sprintf( |
|
343 /* translators: %s: Number of comments. */ |
|
344 _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), |
|
345 $spammed |
|
346 ) . sprintf( |
|
347 ' <a href="%1$s">%2$s</a><br />', |
|
348 esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", 'bulk-comments' ) ), |
|
349 __( 'Undo' ) |
|
350 ); |
298 } |
351 } |
299 |
352 |
300 if ( $unspammed > 0 ) { |
353 if ( $unspammed > 0 ) { |
301 /* translators: %s: Number of comments. */ |
354 $messages[] = sprintf( |
302 $messages[] = sprintf( _n( '%s comment restored from the spam.', '%s comments restored from the spam.', $unspammed ), $unspammed ); |
355 /* translators: %s: Number of comments. */ |
|
356 _n( '%s comment restored from the spam.', '%s comments restored from the spam.', $unspammed ), |
|
357 $unspammed |
|
358 ); |
303 } |
359 } |
304 |
360 |
305 if ( $trashed > 0 ) { |
361 if ( $trashed > 0 ) { |
306 $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0; |
362 $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0; |
307 /* translators: %s: Number of comments. */ |
363 |
308 $messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", 'bulk-comments' ) ) . '">' . __( 'Undo' ) . '</a><br />'; |
364 $messages[] = sprintf( |
|
365 /* translators: %s: Number of comments. */ |
|
366 _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), |
|
367 $trashed |
|
368 ) . sprintf( |
|
369 ' <a href="%1$s">%2$s</a><br />', |
|
370 esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", 'bulk-comments' ) ), |
|
371 __( 'Undo' ) |
|
372 ); |
309 } |
373 } |
310 |
374 |
311 if ( $untrashed > 0 ) { |
375 if ( $untrashed > 0 ) { |
312 /* translators: %s: Number of comments. */ |
376 $messages[] = sprintf( |
313 $messages[] = sprintf( _n( '%s comment restored from the Trash.', '%s comments restored from the Trash.', $untrashed ), $untrashed ); |
377 /* translators: %s: Number of comments. */ |
|
378 _n( '%s comment restored from the Trash.', '%s comments restored from the Trash.', $untrashed ), |
|
379 $untrashed |
|
380 ); |
314 } |
381 } |
315 |
382 |
316 if ( $deleted > 0 ) { |
383 if ( $deleted > 0 ) { |
317 /* translators: %s: Number of comments. */ |
384 $messages[] = sprintf( |
318 $messages[] = sprintf( _n( '%s comment permanently deleted.', '%s comments permanently deleted.', $deleted ), $deleted ); |
385 /* translators: %s: Number of comments. */ |
|
386 _n( '%s comment permanently deleted.', '%s comments permanently deleted.', $deleted ), |
|
387 $deleted |
|
388 ); |
319 } |
389 } |
320 |
390 |
321 if ( $same > 0 ) { |
391 if ( $same > 0 ) { |
322 $comment = get_comment( $same ); |
392 $comment = get_comment( $same ); |
323 if ( $comment ) { |
393 if ( $comment ) { |
324 switch ( $comment->comment_approved ) { |
394 switch ( $comment->comment_approved ) { |
325 case '1': |
395 case '1': |
326 $messages[] = __( 'This comment is already approved.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>'; |
396 $messages[] = __( 'This comment is already approved.' ) . sprintf( |
|
397 ' <a href="%1$s">%2$s</a>', |
|
398 esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ), |
|
399 __( 'Edit comment' ) |
|
400 ); |
327 break; |
401 break; |
328 case 'trash': |
402 case 'trash': |
329 $messages[] = __( 'This comment is already in the Trash.' ) . ' <a href="' . esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ) . '"> ' . __( 'View Trash' ) . '</a>'; |
403 $messages[] = __( 'This comment is already in the Trash.' ) . sprintf( |
|
404 ' <a href="%1$s">%2$s</a>', |
|
405 esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ), |
|
406 __( 'View Trash' ) |
|
407 ); |
330 break; |
408 break; |
331 case 'spam': |
409 case 'spam': |
332 $messages[] = __( 'This comment is already marked as spam.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>'; |
410 $messages[] = __( 'This comment is already marked as spam.' ) . sprintf( |
|
411 ' <a href="%1$s">%2$s</a>', |
|
412 esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ), |
|
413 __( 'Edit comment' ) |
|
414 ); |
333 break; |
415 break; |
334 } |
416 } |
335 } |
417 } |
336 } |
418 } |
337 |
419 |
338 echo '<div id="moderated" class="updated notice is-dismissible"><p>' . implode( "<br/>\n", $messages ) . '</p></div>'; |
420 wp_admin_notice( |
|
421 implode( "<br />\n", $messages ), |
|
422 array( |
|
423 'id' => 'moderated', |
|
424 'additional_classes' => array( 'updated' ), |
|
425 'dismissible' => true, |
|
426 ) |
|
427 ); |
339 } |
428 } |
340 } |
429 } |
341 ?> |
430 ?> |
342 |
431 |
343 <?php $wp_list_table->views(); ?> |
432 <?php $wp_list_table->views(); ?> |