deleted_comment
Action HookDescription
Determines how many days a comment will be left in the Spam queue before being deleted.Hook Information
File Location |
wp-content/plugins/akismet/class.akismet.php
View on GitHub
|
Hook Type | Action |
Line Number | 586 |
Hook Parameters
This hook doesn't accept any parameters.
Usage Examples
Basic Usage
<?php
// Hook into deleted_comment
add_action('deleted_comment', 'my_custom_function');
function my_custom_function() {
// Your custom code here
}
Source Code Context
wp-content/plugins/akismet/class.akismet.php:586
- How this hook is used in WordPress core
<?php
581
582 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->comments} WHERE comment_id IN ( " . $format_string . ' )', $comment_ids ) );
583 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->commentmeta} WHERE comment_id IN ( " . $format_string . ' )', $comment_ids ) );
584
585 foreach ( $comment_ids as $comment_id ) {
586 do_action( 'deleted_comment', $comment_id, $comments[ $comment_id ] );
587 unset( $comments[ $comment_id ] );
588 }
589
590 clean_comment_cache( $comment_ids );
591 do_action( 'akismet_delete_comment_batch', is_countable( $comment_ids ) ? count( $comment_ids ) : 0 );
PHP Documentation
<?php
/**
* Determines how many days a comment will be left in the Spam queue before being deleted.
*
* @param int The default number of days.
*/
Quick Info
- Hook Type: Action
- Parameters: 0
- File: wp-content/plugins/akismet/class.akismet.php
Related Hooks
Related hooks will be displayed here in future updates.