|
@@ 1356-1371 (lines=16) @@
|
| 1353 |
|
*/ |
| 1354 |
|
do_action( 'trash_comment', $comment->comment_ID ); |
| 1355 |
|
|
| 1356 |
|
if ( wp_set_comment_status( $comment, 'trash' ) ) { |
| 1357 |
|
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' ); |
| 1358 |
|
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' ); |
| 1359 |
|
add_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', $comment->comment_approved ); |
| 1360 |
|
add_comment_meta( $comment->comment_ID, '_wp_trash_meta_time', time() ); |
| 1361 |
|
|
| 1362 |
|
/** |
| 1363 |
|
* Fires immediately after a comment is sent to Trash. |
| 1364 |
|
* |
| 1365 |
|
* @since 2.9.0 |
| 1366 |
|
* |
| 1367 |
|
* @param int $comment_id The comment ID. |
| 1368 |
|
*/ |
| 1369 |
|
do_action( 'trashed_comment', $comment->comment_ID ); |
| 1370 |
|
return true; |
| 1371 |
|
} |
| 1372 |
|
|
| 1373 |
|
return false; |
| 1374 |
|
} |
|
@@ 1443-1457 (lines=15) @@
|
| 1440 |
|
*/ |
| 1441 |
|
do_action( 'spam_comment', $comment->comment_ID ); |
| 1442 |
|
|
| 1443 |
|
if ( wp_set_comment_status( $comment, 'spam' ) ) { |
| 1444 |
|
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' ); |
| 1445 |
|
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' ); |
| 1446 |
|
add_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', $comment->comment_approved ); |
| 1447 |
|
add_comment_meta( $comment->comment_ID, '_wp_trash_meta_time', time() ); |
| 1448 |
|
/** |
| 1449 |
|
* Fires immediately after a comment is marked as Spam. |
| 1450 |
|
* |
| 1451 |
|
* @since 2.9.0 |
| 1452 |
|
* |
| 1453 |
|
* @param int $comment_id The comment ID. |
| 1454 |
|
*/ |
| 1455 |
|
do_action( 'spammed_comment', $comment->comment_ID ); |
| 1456 |
|
return true; |
| 1457 |
|
} |
| 1458 |
|
|
| 1459 |
|
return false; |
| 1460 |
|
} |