Action hook 'akismet_spam_caught'

in WP Core File wp-content/plugins/akismet/class.akismet.php at line 420

View Source

akismet_spam_caught

Action Hook
Description
Filter the data that is used to generate the request body for the API call.

Hook Information

File Location wp-content/plugins/akismet/class.akismet.php View on GitHub
Hook Type Action
Line Number 420

Hook Parameters

Type Name Description
array $comment An array of request data.
string $endpoint The API endpoint being requested.

Usage Examples

Basic Usage
<?php
// Hook into akismet_spam_caught
add_action('akismet_spam_caught', 'my_custom_function', 10, 2);

function my_custom_function($comment, $endpoint) {
    // Your custom code here
}

Source Code Context

wp-content/plugins/akismet/class.akismet.php:420 - How this hook is used in WordPress core
<?php
 415  			// akismet_spam_count will be incremented later by comment_is_spam()
 416  			self::$last_comment_result = 'spam';
 417  
 418  			$discard = ( isset( $commentdata['akismet_pro_tip'] ) && $commentdata['akismet_pro_tip'] === 'discard' && self::allow_discard() );
 419  
 420  			do_action( 'akismet_spam_caught', $discard );
 421  
 422  			if ( $discard ) {
 423  				// The spam is obvious, so we're bailing out early.
 424  				// akismet_result_spam() won't be called so bump the counter here
 425  				if ( $incr = apply_filters( 'akismet_spam_count_incr', 1 ) ) {

PHP Documentation

<?php
/**
		 * Filter the data that is used to generate the request body for the API call.
		 *
		 * @since 5.3.1
		 *
		 * @param array $comment An array of request data.
		 * @param string $endpoint The API endpoint being requested.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-content/plugins/akismet/class.akismet.php
Related Hooks

Related hooks will be displayed here in future updates.