diff --git src/wp-includes/comment.php src/wp-includes/comment.php
index 7055db7..ce347dd 100644
|
|
function wp_delete_comment($comment_id, $force_delete = false) { |
1285 | 1285 | * Fires immediately before a comment is deleted from the database. |
1286 | 1286 | * |
1287 | 1287 | * @since 1.2.0 |
| 1288 | * @since 4.9.0 Added the `$comment` argument. |
1288 | 1289 | * |
1289 | 1290 | * @param int $comment_id The comment ID. |
| 1291 | * @param WP_Comment $comment The comment to be deleted. |
1290 | 1292 | */ |
1291 | | do_action( 'delete_comment', $comment->comment_ID ); |
| 1293 | do_action( 'delete_comment', $comment->comment_ID, $comment ); |
1292 | 1294 | |
1293 | 1295 | // Move children up a level. |
1294 | 1296 | $children = $wpdb->get_col( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_parent = %d", $comment->comment_ID) ); |
… |
… |
function wp_delete_comment($comment_id, $force_delete = false) { |
1309 | 1311 | * Fires immediately after a comment is deleted from the database. |
1310 | 1312 | * |
1311 | 1313 | * @since 2.9.0 |
| 1314 | * @since 4.9.0 Added the `$comment` argument. |
1312 | 1315 | * |
1313 | 1316 | * @param int $comment_id The comment ID. |
| 1317 | * @param WP_Comment $comment The deleted comment. |
1314 | 1318 | */ |
1315 | | do_action( 'deleted_comment', $comment->comment_ID ); |
| 1319 | do_action( 'deleted_comment', $comment->comment_ID, $comment ); |
1316 | 1320 | |
1317 | 1321 | $post_id = $comment->comment_post_ID; |
1318 | 1322 | if ( $post_id && $comment->comment_approved == 1 ) |
… |
… |
function wp_trash_comment($comment_id) { |
1348 | 1352 | * Fires immediately before a comment is sent to the Trash. |
1349 | 1353 | * |
1350 | 1354 | * @since 2.9.0 |
| 1355 | * @since 4.9.0 Added the `$comment` argument. |
1351 | 1356 | * |
1352 | 1357 | * @param int $comment_id The comment ID. |
| 1358 | * @param WP_Comment $comment The comment to be trashed. |
1353 | 1359 | */ |
1354 | | do_action( 'trash_comment', $comment->comment_ID ); |
| 1360 | do_action( 'trash_comment', $comment->comment_ID, $comment ); |
1355 | 1361 | |
1356 | 1362 | if ( wp_set_comment_status( $comment, 'trash' ) ) { |
1357 | 1363 | delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' ); |
… |
… |
function wp_trash_comment($comment_id) { |
1363 | 1369 | * Fires immediately after a comment is sent to Trash. |
1364 | 1370 | * |
1365 | 1371 | * @since 2.9.0 |
| 1372 | * @since 4.9.0 Added the `$comment` argument. |
1366 | 1373 | * |
1367 | 1374 | * @param int $comment_id The comment ID. |
| 1375 | * @param WP_Comment $comment The trashed comment. |
1368 | 1376 | */ |
1369 | | do_action( 'trashed_comment', $comment->comment_ID ); |
| 1377 | do_action( 'trashed_comment', $comment->comment_ID, $comment ); |
1370 | 1378 | return true; |
1371 | 1379 | } |
1372 | 1380 | |
… |
… |
function wp_untrash_comment($comment_id) { |
1391 | 1399 | * Fires immediately before a comment is restored from the Trash. |
1392 | 1400 | * |
1393 | 1401 | * @since 2.9.0 |
| 1402 | * @since 4.9.0 Added the `$comment` argument. |
1394 | 1403 | * |
1395 | 1404 | * @param int $comment_id The comment ID. |
| 1405 | * @param WP_Comment $comment The comment to be untrashed. |
1396 | 1406 | */ |
1397 | | do_action( 'untrash_comment', $comment->comment_ID ); |
| 1407 | do_action( 'untrash_comment', $comment->comment_ID, $comment ); |
1398 | 1408 | |
1399 | 1409 | $status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ); |
1400 | 1410 | if ( empty($status) ) |
… |
… |
function wp_untrash_comment($comment_id) { |
1407 | 1417 | * Fires immediately after a comment is restored from the Trash. |
1408 | 1418 | * |
1409 | 1419 | * @since 2.9.0 |
| 1420 | * @since 4.9.0 Added the `$comment` argument. |
1410 | 1421 | * |
1411 | 1422 | * @param int $comment_id The comment ID. |
| 1423 | * @param WP_Comment $comment The untrashed comment. |
1412 | 1424 | */ |
1413 | | do_action( 'untrashed_comment', $comment->comment_ID ); |
| 1425 | do_action( 'untrashed_comment', $comment->comment_ID, $comment ); |
1414 | 1426 | return true; |
1415 | 1427 | } |
1416 | 1428 | |
… |
… |
function wp_spam_comment( $comment_id ) { |
1435 | 1447 | * Fires immediately before a comment is marked as Spam. |
1436 | 1448 | * |
1437 | 1449 | * @since 2.9.0 |
| 1450 | * @since 4.9.0 Added the `$comment` argument. |
1438 | 1451 | * |
1439 | 1452 | * @param int $comment_id The comment ID. |
| 1453 | * @param WP_Comment $comment The comment to be marked as spam. |
1440 | 1454 | */ |
1441 | | do_action( 'spam_comment', $comment->comment_ID ); |
| 1455 | do_action( 'spam_comment', $comment->comment_ID, $comment ); |
1442 | 1456 | |
1443 | 1457 | if ( wp_set_comment_status( $comment, 'spam' ) ) { |
1444 | 1458 | delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' ); |
… |
… |
function wp_spam_comment( $comment_id ) { |
1449 | 1463 | * Fires immediately after a comment is marked as Spam. |
1450 | 1464 | * |
1451 | 1465 | * @since 2.9.0 |
| 1466 | * @since 4.9.0 Added the `$comment` argument. |
1452 | 1467 | * |
1453 | 1468 | * @param int $comment_id The comment ID. |
| 1469 | * @param WP_Comment $comment The comment marked as spam. |
1454 | 1470 | */ |
1455 | | do_action( 'spammed_comment', $comment->comment_ID ); |
| 1471 | do_action( 'spammed_comment', $comment->comment_ID, $comment ); |
1456 | 1472 | return true; |
1457 | 1473 | } |
1458 | 1474 | |
… |
… |
function wp_unspam_comment( $comment_id ) { |
1477 | 1493 | * Fires immediately before a comment is unmarked as Spam. |
1478 | 1494 | * |
1479 | 1495 | * @since 2.9.0 |
| 1496 | * @since 4.9.0 Added the `$comment` argument. |
1480 | 1497 | * |
1481 | 1498 | * @param int $comment_id The comment ID. |
| 1499 | * @param WP_Comment $comment The comment to be unmarked as spam. |
1482 | 1500 | */ |
1483 | | do_action( 'unspam_comment', $comment->comment_ID ); |
| 1501 | do_action( 'unspam_comment', $comment->comment_ID, $comment ); |
1484 | 1502 | |
1485 | 1503 | $status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ); |
1486 | 1504 | if ( empty($status) ) |
… |
… |
function wp_unspam_comment( $comment_id ) { |
1493 | 1511 | * Fires immediately after a comment is unmarked as Spam. |
1494 | 1512 | * |
1495 | 1513 | * @since 2.9.0 |
| 1514 | * @since 4.9.0 Added the `$comment` argument. |
1496 | 1515 | * |
1497 | 1516 | * @param int $comment_id The comment ID. |
| 1517 | * @param WP_Comment $comment The comment unmarked as spam. |
1498 | 1518 | */ |
1499 | | do_action( 'unspammed_comment', $comment->comment_ID ); |
| 1519 | do_action( 'unspammed_comment', $comment->comment_ID, $comment ); |
1500 | 1520 | return true; |
1501 | 1521 | } |
1502 | 1522 | |